/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @signatureAlgorithm = 'v2';
  @endpointRule = 'regional';
  @endpointMap = {
    'ap-northeast-2-pop' = 'hbr.aliyuncs.com',
    'cn-beijing-finance-pop' = 'hbr.aliyuncs.com',
    'cn-beijing-gov-1' = 'hbr.aliyuncs.com',
    'cn-beijing-nu16-b01' = 'hbr.aliyuncs.com',
    'cn-edge-1' = 'hbr.aliyuncs.com',
    'cn-fujian' = 'hbr.aliyuncs.com',
    'cn-haidian-cm12-c01' = 'hbr.aliyuncs.com',
    'cn-hangzhou-bj-b01' = 'hbr.aliyuncs.com',
    'cn-hangzhou-internal-prod-1' = 'hbr.aliyuncs.com',
    'cn-hangzhou-internal-test-1' = 'hbr.aliyuncs.com',
    'cn-hangzhou-internal-test-2' = 'hbr.aliyuncs.com',
    'cn-hangzhou-internal-test-3' = 'hbr.aliyuncs.com',
    'cn-hangzhou-test-306' = 'hbr.aliyuncs.com',
    'cn-hongkong-finance-pop' = 'hbr.aliyuncs.com',
    'cn-huhehaote-nebula-1' = 'hbr.aliyuncs.com',
    'cn-qingdao-nebula' = 'hbr.aliyuncs.com',
    'cn-shanghai-et15-b01' = 'hbr.aliyuncs.com',
    'cn-shanghai-et2-b01' = 'hbr.aliyuncs.com',
    'cn-shanghai-inner' = 'hbr.aliyuncs.com',
    'cn-shanghai-internal-test-1' = 'hbr.aliyuncs.com',
    'cn-shenzhen-inner' = 'hbr.aliyuncs.com',
    'cn-shenzhen-st4-d01' = 'hbr.aliyuncs.com',
    'cn-shenzhen-su18-b01' = 'hbr.aliyuncs.com',
    'cn-wuhan' = 'hbr.aliyuncs.com',
    'cn-yushanfang' = 'hbr.aliyuncs.com',
    'cn-zhangbei' = 'hbr.aliyuncs.com',
    'cn-zhangbei-na61-b01' = 'hbr.aliyuncs.com',
    'cn-zhangjiakou-na62-a01' = 'hbr.aliyuncs.com',
    'cn-zhengzhou-nebula-1' = 'hbr.aliyuncs.com',
    'eu-west-1-oxs' = 'hbr.aliyuncs.com',
    'rus-west-1-pop' = 'hbr.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('hbr', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model OtsDetail {
  tableNames?: [ string ](name='TableNames'),
}

model OtsTableRestoreDetail {
  batchChannelCount?: int32(name='BatchChannelCount'),
  indexNameSuffix?: string(name='IndexNameSuffix'),
  overwriteExisting?: boolean(name='OverwriteExisting'),
  reGenerateAutoIncrementPK?: boolean(name='ReGenerateAutoIncrementPK'),
  restoreIndex?: boolean(name='RestoreIndex'),
  restoreSearchIndex?: boolean(name='RestoreSearchIndex'),
  searchIndexNameSuffix?: string(name='SearchIndexNameSuffix'),
}

model Report {
  failedFiles?: string(name='FailedFiles', example='temp/report/r-0000dnz7p4pk31u6madf_failed.csv'),
  skippedFiles?: string(name='SkippedFiles', example='temp/report/r-0000dnz7p4pk31u6madf_skipped.csv'),
  successFiles?: string(name='SuccessFiles', example='temp/report/r-0000dnz7p4pk31u6madf_success.csv'),
  totalFiles?: string(name='TotalFiles', example='temp/report/r-0000dnz7p4pk31u6madf_total.csv'),
}

model Rule {
  backupType?: string(name='BackupType'),
  destinationRegionId?: string(name='DestinationRegionId'),
  destinationRetention?: long(name='DestinationRetention'),
  disabled?: boolean(name='Disabled'),
  doCopy?: boolean(name='DoCopy'),
  retention?: long(name='Retention'),
  ruleName?: string(name='RuleName'),
  schedule?: string(name='Schedule'),
}

model AddContainerClusterRequest {
  clusterType?: string(name='ClusterType', description='The type of the cluster. Only Container Service for Kubernetes (ACK) clusters are supported.

This parameter is required.', example='ACK'),
  description?: string(name='Description', description='The description of the cluster.', example='description ack pv backup'),
  identifier?: string(name='Identifier', description='The ID of the cluster that you want to register.

This parameter is required.', example='cca8f35f0e0d84540b49d994511c2c87a'),
  name?: string(name='Name', description='The name of the cluster.', example='ack_pv_backup_location'),
  networkType?: string(name='NetworkType', description='The network type of the cluster. Valid values:

*   **CLASSIC**: the classic network
*   **VPC**: a virtual private cloud (VPC)

This parameter is required.', example='VPC'),
}

model AddContainerClusterResponseBody = {
  clusterId?: string(name='ClusterId', description='The ID of the cluster.', example='cc-00049slr9iuvvv6pp134'),
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the request is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the request is successful, a value of successful is returned. If the request fails, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1FCBC078-FFCB-542A-8555-566477679720'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.

*   true: The request is successful.
*   false: The request fails.', example='true'),
  token?: string(name='Token', description='The token that is used to register the Hybrid Backup Recovery (HBR) client in the cluster.', example='eyJhY2NvdW*****VnZpgXQC5A=='),
}

model AddContainerClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddContainerClusterResponseBody(name='body'),
}

/**
 * @summary Registers a Container Service for Kubernetes (ACK) cluster.
 *
 * @param request AddContainerClusterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddContainerClusterResponse
 */
async function addContainerClusterWithOptions(request: AddContainerClusterRequest, runtime: Util.RuntimeOptions): AddContainerClusterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterType)) {
    query['ClusterType'] = request.clusterType;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.identifier)) {
    query['Identifier'] = request.identifier;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.networkType)) {
    query['NetworkType'] = request.networkType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddContainerCluster',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Registers a Container Service for Kubernetes (ACK) cluster.
 *
 * @param request AddContainerClusterRequest
 * @return AddContainerClusterResponse
 */
async function addContainerCluster(request: AddContainerClusterRequest): AddContainerClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  return addContainerClusterWithOptions(request, runtime);
}

model CancelBackupJobRequest {
  jobId?: string(name='JobId', description='The ID of the backup job.

This parameter is required.', example='j-******************************'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-*****************************'),
}

model CancelBackupJobResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the request is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the request is successful, a value of successful is returned. If the request fails, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.

*   true: The request is successful.
*   false: The request fails.', example='true'),
}

model CancelBackupJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelBackupJobResponseBody(name='body'),
}

/**
 * @summary Cancels a backup job.
 *
 * @param request CancelBackupJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelBackupJobResponse
 */
async function cancelBackupJobWithOptions(request: CancelBackupJobRequest, runtime: Util.RuntimeOptions): CancelBackupJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CancelBackupJob',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Cancels a backup job.
 *
 * @param request CancelBackupJobRequest
 * @return CancelBackupJobResponse
 */
async function cancelBackupJob(request: CancelBackupJobRequest): CancelBackupJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelBackupJobWithOptions(request, runtime);
}

model CancelRestoreJobRequest {
  restoreId?: string(name='RestoreId', description='The ID of the restore job.

This parameter is required.', example='r-*********************'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.

This parameter is required.', example='v-*********************'),
}

model CancelRestoreJobResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model CancelRestoreJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelRestoreJobResponseBody(name='body'),
}

/**
 * @summary Cancels a restore job.
 *
 * @param request CancelRestoreJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelRestoreJobResponse
 */
async function cancelRestoreJobWithOptions(request: CancelRestoreJobRequest, runtime: Util.RuntimeOptions): CancelRestoreJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.restoreId)) {
    query['RestoreId'] = request.restoreId;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CancelRestoreJob',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Cancels a restore job.
 *
 * @param request CancelRestoreJobRequest
 * @return CancelRestoreJobResponse
 */
async function cancelRestoreJob(request: CancelRestoreJobRequest): CancelRestoreJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelRestoreJobWithOptions(request, runtime);
}

model ChangeResourceGroupRequest {
  newResourceGroupId?: string(name='NewResourceGroupId', description='The ID of the new resource group. You can view the available resource groups in the Resource Management console.

This parameter is required.', example='rg-bp67acfmxazb4p****'),
  resourceId?: string(name='ResourceId', description='The ID of the resource. The value of this parameter varies with the resource type. For example, if the ResourceType parameter is set to vault, the ResourceId parameter specifies the ID of the backup vault.

This parameter is required.', example='v-0002vido6j5zyh5k****'),
  resourceType?: string(name='ResourceType', description='The resource type. Valid values:

*   **vault**: backup vault
*   **client**: backup client
*   **hanainstance**: SAP HANA instance

This parameter is required.', example='vault'),
}

model ChangeResourceGroupResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='C438054F-9088-5D1B-AED0-0EA86D9C65F4'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model ChangeResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeResourceGroupResponseBody(name='body'),
}

/**
 * @summary Changes the resource group to which an instance belongs.
 *
 * @description *   In the Cloud Backup console, you can use resource groups to manage resources such as backup vaults, Cloud Backup clients, and SAP HANA instances.
 * *   A resource is a cloud service entity that you create on Alibaba Cloud, such as an Elastic Compute Service (ECS) instance, a backup vault, or an SAP HANA instance.
 * *   You can sort resources owned by your Alibaba Cloud account into various resource groups. Resource groups facilitate resource management among multiple projects or applications within your Alibaba Cloud account and simplify permission management.
 *
 * @param request ChangeResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeResourceGroupResponse
 */
async function changeResourceGroupWithOptions(request: ChangeResourceGroupRequest, runtime: Util.RuntimeOptions): ChangeResourceGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.newResourceGroupId)) {
    body['NewResourceGroupId'] = request.newResourceGroupId;
  }
  if (!Util.isUnset(request.resourceId)) {
    body['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    body['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ChangeResourceGroup',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the resource group to which an instance belongs.
 *
 * @description *   In the Cloud Backup console, you can use resource groups to manage resources such as backup vaults, Cloud Backup clients, and SAP HANA instances.
 * *   A resource is a cloud service entity that you create on Alibaba Cloud, such as an Elastic Compute Service (ECS) instance, a backup vault, or an SAP HANA instance.
 * *   You can sort resources owned by your Alibaba Cloud account into various resource groups. Resource groups facilitate resource management among multiple projects or applications within your Alibaba Cloud account and simplify permission management.
 *
 * @param request ChangeResourceGroupRequest
 * @return ChangeResourceGroupResponse
 */
async function changeResourceGroup(request: ChangeResourceGroupRequest): ChangeResourceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeResourceGroupWithOptions(request, runtime);
}

model CheckRoleRequest {
  checkRoleType?: string(name='CheckRoleType', description='The type of the role. Valid values:

*   EcsRole: a role with the permissions to access Elastic Compute Service (ECS) resources
*   CsgRole: a role with the permissions to perform Cloud Storage Gateway (CSG) backup
*   NasRole: a role with the permissions to perform NAS backup
*   OssRole: a role with the permissions to perform Object Storage Service (OSS) backup
*   UdmRole: a role with the permissions to perform ECS instance backup
*   VMwareLocalRole: a role with the permissions to back up on-premises VMware virtual machines (VMs)
*   VMwareCloudRole: a role with the permissions to back up VMs deployed on Alibaba Cloud VMware Service (ACVS)
*   EcsBackupRole: a role with the permissions to perform ECS backup
*   OtsRole: a role with the permissions to perform Tablestore backup
*   CrossAccountRole: a role with the permissions to perform cross-account backup', example='OssRole'),
  crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the Resource Access Management (RAM) role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='BackupRole'),
  crossAccountUserId?: long(name='CrossAccountUserId', description='The ID of the source Alibaba Cloud account that authorizes the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='158975xxxxx4625'),
}

model CheckRoleResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='2F63CA9B-744E-51C0-A638-27882BB03078'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model CheckRoleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckRoleResponseBody(name='body'),
}

/**
 * @summary Checks whether the user has permissions to access the current resource or page.
 *
 * @param request CheckRoleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckRoleResponse
 */
async function checkRoleWithOptions(request: CheckRoleRequest, runtime: Util.RuntimeOptions): CheckRoleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.checkRoleType)) {
    query['CheckRoleType'] = request.checkRoleType;
  }
  if (!Util.isUnset(request.crossAccountRoleName)) {
    query['CrossAccountRoleName'] = request.crossAccountRoleName;
  }
  if (!Util.isUnset(request.crossAccountUserId)) {
    query['CrossAccountUserId'] = request.crossAccountUserId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckRole',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Checks whether the user has permissions to access the current resource or page.
 *
 * @param request CheckRoleRequest
 * @return CheckRoleResponse
 */
async function checkRole(request: CheckRoleRequest): CheckRoleResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkRoleWithOptions(request, runtime);
}

model CreateBackupJobRequest {
  backupType?: string(name='BackupType', description='The backup type. This parameter is required only if you set the SourceType parameter to UDM_ECS.

*   **COMPLETE**: full backup', example='INCREMENTAL'),
  clusterId?: string(name='ClusterId', description='You do not need to specify this parameter.', example='cl-00068btz******oku'),
  containerClusterId?: string(name='ContainerClusterId', description='You do not need to specify this parameter.', example='cc-000xxxxxxxxxxxxxxi00'),
  containerResources?: string(name='ContainerResources', description='You do not need to specify this parameter.', example='[{\\\\"resourceType\\\\":\\\\"PV\\\\",\\\\"backupMethod\\\\":\\\\"FILE\\\\",\\\\"resourceId\\\\":\\\\"674dac6d-74cd-47e9-a675-09e2f10d2c45\\\\",\\\\"resourceInfo\\\\":\\\\"{\\\\\\\\\\\\"pv_name\\\\\\\\\\\\":\\\\\\\\\\\\"nas-650dac6d-74cd-47e9-a675-09e2f10d2c45\\\\\\\\\\\\",\\\\\\\\\\\\"pv_size\\\\\\\\\\\\":\\\\\\\\\\\\"8Gi\\\\\\\\\\\\",\\\\\\\\\\\\"storage_class\\\\\\\\\\\\":\\\\\\\\\\\\"alibabacloud-cnfs-nas\\\\\\\\\\\\",\\\\\\\\\\\\"pvc_name\\\\\\\\\\\\":\\\\\\\\\\\\"data-postgresql-default-0\\\\\\\\\\\\",\\\\\\\\\\\\"namespace\\\\\\\\\\\\":\\\\\\\\\\\\"database\\\\\\\\\\\\"}\\\\",\\\\"host\\\\":\\\\"cn-huhehaote.192.168.13.133\\\\",\\\\"hostPrefix\\\\":\\\\"6f5e758e-8d35-4584-b9ce-8333adfc7547/volumes/kubernetes.io~csi/nas-670dac6d-74cd-47e9-a675-09e2f10d2c45/mount\\\\",\\\\"pvPath\\\\":\\\\"/\\\\"}]'),
  crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the RAM role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='BackupRole'),
  crossAccountType?: string(name='CrossAccountType', description='Specifies whether data is backed up within the same Alibaba Cloud account or across Alibaba Cloud accounts. Valid values:

*   SELF_ACCOUNT: Data is backed up within the same Alibaba Cloud account.
*   CROSS_ACCOUNT: Data is backed up across Alibaba Cloud accounts.', example='SELF_ACCOUNT'),
  crossAccountUserId?: long(name='CrossAccountUserId', description='The ID of the source Alibaba Cloud account that authorizes the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='158975xxxxxx4625'),
  detail?: map[string]any(name='Detail', description='This parameter is required only if you set the **SourceType** parameter to **UDM_ECS**. The value is a JSON string. Valid values:

*   doCopy: specifies whether to enable remote replication.

*   destinationRegionId: the destination region for remote replication.

*   destinationRetention: the retention period of the backup point for remote replication.

*   diskIdList: the IDs of the disks that are to be backed up. If this parameter is left empty, all disks are backed up.

*   snapshotGroup: specifies whether to use a snapshot-consistent group. This parameter is valid only if all disks of the ECS instance are Enterprise SSDs (ESSDs).

*   appConsistent: specifies whether to use the application-consistent backup feature. This parameter must be used with the preScriptPath and postScriptPath parameters.

*   preScriptPath: the path to the pre-freeze scripts.

*   postScriptPath: the path to the post-thaw scripts.

*   enableWriters: This parameter is required only if you set the **AppConsistent** parameter to **true**. This parameter specifies whether to create application-consistent snapshots.

    *   true: creates application-consistent snapshots.
    *   false: creates file system-consistent snapshots.

*   enableFsFreeze: This parameter is required only if you set the **AppConsistent** parameter to **true**. This parameter specifies whether to enable Linux fsfreeze to put file systems into the read-only state before application-consistent snapshots are created. Default value: true.

*   timeoutSeconds: This parameter is required only if you set the **AppConsistent** parameter to **true**. This parameter specifies the I/O freeze timeout period. Default value: 30. Unit: seconds.', example='{
    "doCopy": false,
    "destinationRegionId": "",
    "destinationRetention": null,
    "diskIdList": [],
    "snapshotGroup": false,
    "appConsistent": false,
    "enableWriters": true,
    "preScriptPath": "",
    "postScriptPath": "",
    "enableFsFreeze": true,
    "timeoutInSeconds": 60
}'),
  exclude?: string(name='Exclude', description='This parameter does not take effect if you set the **SourceType** parameter to **UDM_ECS**. This parameter specifies the paths to the files that are excluded from the backup job. The value can be up to 255 characters in length.', example='["/var", "/proc"]'),
  include?: string(name='Include', description='This parameter does not take effect if you set the **SourceType** parameter to **UDM_ECS**. This parameter specifies the paths to the files that are backed up. The value can be up to 255 characters in length.', example='["/home/alice/*.pdf", "/home/bob/*.txt"]'),
  initiatedByAck?: boolean(name='InitiatedByAck', description='false or left empty', example='false'),
  instanceId?: string(name='InstanceId', description='This parameter is required only if you set the **SourceType** parameter to **UDM_ECS**. This parameter specifies the ID of the ECS instance.', example='i-bp1xxxxxxxxxxxxxxysm'),
  jobName?: string(name='JobName', description='The name of the backup job.', example='k8s-backup-infra-20220131150046-hbr'),
  options?: string(name='Options', description='You do not need to specify this parameter.', example='{"UseVSS":false}'),
  retention?: long(name='Retention', description='The retention period of the backup data. Unit: days.', example='15'),
  sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **UDM_ECS**: Elastic Compute Service (ECS) instance

This parameter is required.', example='CONTAINER'),
  speedLimit?: string(name='SpeedLimit', description='This parameter does not take effect if you set the **SourceType** parameter to **UDM_ECS**. This parameter specifies the throttling rules. Format: `{start}|{end}|{bandwidth}`. Separate multiple throttling rules with vertical bars (|). A specified time range cannot overlap with another time range.

*   **start**: the start hour.
*   **end**: the end hour.
*   **bandwidth**: the bandwidth. Unit: KB/s.', example='0:24:NaN'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault. This parameter is not required if you set the SourceType parameter to UDM_ECS.', example='v-000xxxxxxxxxxxxxxy1v'),
}

model CreateBackupJobShrinkRequest {
  backupType?: string(name='BackupType', description='The backup type. This parameter is required only if you set the SourceType parameter to UDM_ECS.

*   **COMPLETE**: full backup', example='INCREMENTAL'),
  clusterId?: string(name='ClusterId', description='You do not need to specify this parameter.', example='cl-00068btz******oku'),
  containerClusterId?: string(name='ContainerClusterId', description='You do not need to specify this parameter.', example='cc-000xxxxxxxxxxxxxxi00'),
  containerResources?: string(name='ContainerResources', description='You do not need to specify this parameter.', example='[{\\\\"resourceType\\\\":\\\\"PV\\\\",\\\\"backupMethod\\\\":\\\\"FILE\\\\",\\\\"resourceId\\\\":\\\\"674dac6d-74cd-47e9-a675-09e2f10d2c45\\\\",\\\\"resourceInfo\\\\":\\\\"{\\\\\\\\\\\\"pv_name\\\\\\\\\\\\":\\\\\\\\\\\\"nas-650dac6d-74cd-47e9-a675-09e2f10d2c45\\\\\\\\\\\\",\\\\\\\\\\\\"pv_size\\\\\\\\\\\\":\\\\\\\\\\\\"8Gi\\\\\\\\\\\\",\\\\\\\\\\\\"storage_class\\\\\\\\\\\\":\\\\\\\\\\\\"alibabacloud-cnfs-nas\\\\\\\\\\\\",\\\\\\\\\\\\"pvc_name\\\\\\\\\\\\":\\\\\\\\\\\\"data-postgresql-default-0\\\\\\\\\\\\",\\\\\\\\\\\\"namespace\\\\\\\\\\\\":\\\\\\\\\\\\"database\\\\\\\\\\\\"}\\\\",\\\\"host\\\\":\\\\"cn-huhehaote.192.168.13.133\\\\",\\\\"hostPrefix\\\\":\\\\"6f5e758e-8d35-4584-b9ce-8333adfc7547/volumes/kubernetes.io~csi/nas-670dac6d-74cd-47e9-a675-09e2f10d2c45/mount\\\\",\\\\"pvPath\\\\":\\\\"/\\\\"}]'),
  crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the RAM role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='BackupRole'),
  crossAccountType?: string(name='CrossAccountType', description='Specifies whether data is backed up within the same Alibaba Cloud account or across Alibaba Cloud accounts. Valid values:

*   SELF_ACCOUNT: Data is backed up within the same Alibaba Cloud account.
*   CROSS_ACCOUNT: Data is backed up across Alibaba Cloud accounts.', example='SELF_ACCOUNT'),
  crossAccountUserId?: long(name='CrossAccountUserId', description='The ID of the source Alibaba Cloud account that authorizes the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='158975xxxxxx4625'),
  detailShrink?: string(name='Detail', description='This parameter is required only if you set the **SourceType** parameter to **UDM_ECS**. The value is a JSON string. Valid values:

*   doCopy: specifies whether to enable remote replication.

*   destinationRegionId: the destination region for remote replication.

*   destinationRetention: the retention period of the backup point for remote replication.

*   diskIdList: the IDs of the disks that are to be backed up. If this parameter is left empty, all disks are backed up.

*   snapshotGroup: specifies whether to use a snapshot-consistent group. This parameter is valid only if all disks of the ECS instance are Enterprise SSDs (ESSDs).

*   appConsistent: specifies whether to use the application-consistent backup feature. This parameter must be used with the preScriptPath and postScriptPath parameters.

*   preScriptPath: the path to the pre-freeze scripts.

*   postScriptPath: the path to the post-thaw scripts.

*   enableWriters: This parameter is required only if you set the **AppConsistent** parameter to **true**. This parameter specifies whether to create application-consistent snapshots.

    *   true: creates application-consistent snapshots.
    *   false: creates file system-consistent snapshots.

*   enableFsFreeze: This parameter is required only if you set the **AppConsistent** parameter to **true**. This parameter specifies whether to enable Linux fsfreeze to put file systems into the read-only state before application-consistent snapshots are created. Default value: true.

*   timeoutSeconds: This parameter is required only if you set the **AppConsistent** parameter to **true**. This parameter specifies the I/O freeze timeout period. Default value: 30. Unit: seconds.', example='{
    "doCopy": false,
    "destinationRegionId": "",
    "destinationRetention": null,
    "diskIdList": [],
    "snapshotGroup": false,
    "appConsistent": false,
    "enableWriters": true,
    "preScriptPath": "",
    "postScriptPath": "",
    "enableFsFreeze": true,
    "timeoutInSeconds": 60
}'),
  exclude?: string(name='Exclude', description='This parameter does not take effect if you set the **SourceType** parameter to **UDM_ECS**. This parameter specifies the paths to the files that are excluded from the backup job. The value can be up to 255 characters in length.', example='["/var", "/proc"]'),
  include?: string(name='Include', description='This parameter does not take effect if you set the **SourceType** parameter to **UDM_ECS**. This parameter specifies the paths to the files that are backed up. The value can be up to 255 characters in length.', example='["/home/alice/*.pdf", "/home/bob/*.txt"]'),
  initiatedByAck?: boolean(name='InitiatedByAck', description='false or left empty', example='false'),
  instanceId?: string(name='InstanceId', description='This parameter is required only if you set the **SourceType** parameter to **UDM_ECS**. This parameter specifies the ID of the ECS instance.', example='i-bp1xxxxxxxxxxxxxxysm'),
  jobName?: string(name='JobName', description='The name of the backup job.', example='k8s-backup-infra-20220131150046-hbr'),
  options?: string(name='Options', description='You do not need to specify this parameter.', example='{"UseVSS":false}'),
  retention?: long(name='Retention', description='The retention period of the backup data. Unit: days.', example='15'),
  sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **UDM_ECS**: Elastic Compute Service (ECS) instance

This parameter is required.', example='CONTAINER'),
  speedLimit?: string(name='SpeedLimit', description='This parameter does not take effect if you set the **SourceType** parameter to **UDM_ECS**. This parameter specifies the throttling rules. Format: `{start}|{end}|{bandwidth}`. Separate multiple throttling rules with vertical bars (|). A specified time range cannot overlap with another time range.

*   **start**: the start hour.
*   **end**: the end hour.
*   **bandwidth**: the bandwidth. Unit: KB/s.', example='0:24:NaN'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault. This parameter is not required if you set the SourceType parameter to UDM_ECS.', example='v-000xxxxxxxxxxxxxxy1v'),
}

model CreateBackupJobResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the request was successful.', example='200'),
  jobId?: string(name='JobId', description='The ID of the backup job.', example='job-000csy09q50a2jdcbwbo'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='25F49E7B-7E39-542E-83AD-62E6E7F73786'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model CreateBackupJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateBackupJobResponseBody(name='body'),
}

/**
 * @summary Creates a backup job.
 *
 * @param tmpReq CreateBackupJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateBackupJobResponse
 */
async function createBackupJobWithOptions(tmpReq: CreateBackupJobRequest, runtime: Util.RuntimeOptions): CreateBackupJobResponse {
  Util.validateModel(tmpReq);
  var request = new CreateBackupJobShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.detail)) {
    request.detailShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.detail, 'Detail', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.backupType)) {
    query['BackupType'] = request.backupType;
  }
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.containerClusterId)) {
    query['ContainerClusterId'] = request.containerClusterId;
  }
  if (!Util.isUnset(request.containerResources)) {
    query['ContainerResources'] = request.containerResources;
  }
  if (!Util.isUnset(request.crossAccountRoleName)) {
    query['CrossAccountRoleName'] = request.crossAccountRoleName;
  }
  if (!Util.isUnset(request.crossAccountType)) {
    query['CrossAccountType'] = request.crossAccountType;
  }
  if (!Util.isUnset(request.crossAccountUserId)) {
    query['CrossAccountUserId'] = request.crossAccountUserId;
  }
  if (!Util.isUnset(request.detailShrink)) {
    query['Detail'] = request.detailShrink;
  }
  if (!Util.isUnset(request.exclude)) {
    query['Exclude'] = request.exclude;
  }
  if (!Util.isUnset(request.include)) {
    query['Include'] = request.include;
  }
  if (!Util.isUnset(request.initiatedByAck)) {
    query['InitiatedByAck'] = request.initiatedByAck;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.jobName)) {
    query['JobName'] = request.jobName;
  }
  if (!Util.isUnset(request.options)) {
    query['Options'] = request.options;
  }
  if (!Util.isUnset(request.retention)) {
    query['Retention'] = request.retention;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  if (!Util.isUnset(request.speedLimit)) {
    query['SpeedLimit'] = request.speedLimit;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateBackupJob',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a backup job.
 *
 * @param request CreateBackupJobRequest
 * @return CreateBackupJobResponse
 */
async function createBackupJob(request: CreateBackupJobRequest): CreateBackupJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return createBackupJobWithOptions(request, runtime);
}

model CreateBackupPlanRequest {
  backupType?: string(name='BackupType', description='Backup type. Value: **COMPLETE**, indicating a full backup.

This parameter is required.', example='COMPLETE'),
  bucket?: string(name='Bucket', description='This parameter is required when **SourceType** is set to **OSS**. It represents the OSS bucket name.', example='hbr-backup-oss'),
  changeListPath?: string(name='ChangeListPath', description='Configuration for the incremental file synchronization list. (Required only for synchronization)', example='{"dataSourceId": "ds-123456789", "path": "/changelist"}'),
  clusterId?: string(name='ClusterId', description='The ID of the client group that executes the data synchronization plan. This parameter is required only for data synchronization.', example='cl-***************'),
  createTime?: long(name='CreateTime', description='This parameter is required when **SourceType** is set to **NAS**. It represents the creation time of the file system, in UNIX timestamp, in seconds.', example='1607436917'),
  crossAccountRoleName?: string(name='CrossAccountRoleName', description='The role name created in the RAM of the original account for cross-account backup.', example='BackupRole'),
  crossAccountType?: string(name='CrossAccountType', description='Cross-account backup type. Supported values:
- SELF_ACCOUNT: Backup within the same account
- CROSS_ACCOUNT: Cross-account backup', example='CROSS_ACCOUNT'),
  crossAccountUserId?: long(name='CrossAccountUserId', description='The original account ID used for cross-account backup.', example='15897534xxxx4625'),
  dataSourceId?: string(name='DataSourceId', description='The ID of the data source. This parameter is required only for data synchronization.', example='ds-****************'),
  destDataSourceDetail?: map[string]any(name='DestDataSourceDetail', description='Destination data source details. (Required only for synchronization)', example='{\\\\"prefix\\\\":\\\\"/\\\\"}'),
  destDataSourceId?: string(name='DestDataSourceId', description='Destination data source ID. (Required only for synchronization)', example='ds-*********************'),
  destSourceType?: string(name='DestSourceType', description='Destination data source type. (Required only for synchronization)', example='OSS'),
  detail?: map[string]any(name='Detail', description='Details of the whole machine backup, in JSON string format.

* snapshotGroup: Whether to use a consistent snapshot group (only valid if all instance disks are ESSD).
* appConsistent: Whether to use application consistency (requires the use of preScriptPath and postScriptPath parameters).
* preScriptPath: Path to the freeze script.
* postScriptPath: Path to the thaw script.', example='{\\\\"EnableFsFreeze\\\\":true,\\\\"appConsistent\\\\":false,\\\\"postScriptPath\\\\":\\\\"\\\\",\\\\"preScriptPath\\\\":\\\\"\\\\",\\\\"snapshotGroup\\\\":true,\\\\"timeoutInSeconds\\\\":60}'),
  disabled?: boolean(name='Disabled', description='Is the plan disabled by default', example='true'),
  exclude?: string(name='Exclude', description='This parameter is required only when **SourceType** is set to **ECS_FILE**. It specifies the path that should not be backed up, meaning all files under this path will not be included in the backup. The maximum length is 255 characters.', example='["/var", "/proc"]'),
  fileSystemId?: string(name='FileSystemId', description='This parameter is required when **SourceType** is set to **NAS**. It represents the file system ID.', example='005494'),
  include?: string(name='Include', description='This parameter is required when **SourceType** is set to **ECS_FILE**. It represents the path to be backed up, and all files under this path will be backed up. Supports up to 255 characters.', example='["/home/alice/*.pdf", "/home/bob/*.txt"]'),
  instanceId?: string(name='InstanceId', description='This parameter is required when **SourceType** is set to **ECS_FILE**. It represents the ECS instance ID.', example='i-m5e*****6q'),
  instanceName?: string(name='InstanceName', description='Table store instance name.', example='instancename'),
  keepLatestSnapshots?: long(name='KeepLatestSnapshots', description='Whether to enable retaining at least one backup version.
- 0 - Do not retain
- 1 - Retain', example='1'),
  options?: string(name='Options', description='This parameter is required when **SourceType** is set to **ECS_FILE**. It indicates whether to use the Windows system VSS to define the backup path.

- This feature only supports Windows type ECS instances.
- If there are data changes in the backup source and you need to ensure consistency between the backup data and the source data, you can configure it as `["UseVSS":true]`.
- After choosing to use VSS, multiple file directories cannot be backed up simultaneously.', example='{"UseVSS":false}'),
  otsDetail?: OtsDetail(name='OtsDetail', description='The details about the Tablestore instance.'),
  path?: [ string ](name='Path', description='Backup paths.'),
  planName?: string(name='PlanName', description='Name of the backup plan. 1 to 64 characters. The name must be unique for each data source type within a single backup vault.

This parameter is required.', example='planname'),
  prefix?: string(name='Prefix', description='This parameter is required when **SourceType** is set to **OSS**. It represents the backup prefix. When specified, only objects matching the prefix are backed up.', example='oss-prefix'),
  retention?: long(name='Retention', description='Number of days to retain the backup, with a minimum value of 1, in days.', example='7'),
  rule?: [ 
    {
      backupType?: string(name='BackupType', description='Backup type.', example='COMPLETE'),
      destinationRegionId?: string(name='DestinationRegionId', description='ID of the region for offsite replication.', example='cn-hangzhou'),
      destinationRetention?: long(name='DestinationRetention', description='Number of days to retain offsite backups.', example='7'),
      disabled?: boolean(name='Disabled', description='Whether the rule is enabled.', example='true'),
      doCopy?: boolean(name='DoCopy', description='Whether to enable offsite replication.', example='true'),
      retention?: long(name='Retention', description='Backup retention period.', example='7'),
      ruleName?: string(name='RuleName', description='Rule name.', example='rule-test-name'),
      schedule?: string(name='Schedule', description='Backup strategy. Optional format: I|{startTime}|{interval}. This means that a backup task is executed every {interval} starting from {startTime}. Backup tasks for past times will not be executed. If the previous backup task has not been completed, the next backup task will not be triggered. For example, I|1631685600|P1D means a backup is performed every day starting from 2021-09-15 14:00:00.

- startTime: The start time of the backup, in UNIX time, in seconds.
- interval: ISO8601 time interval. For example, PT1H means an interval of one hour. P1D means an interval of one day.', example='I|1602673264|P1D'),
    }
  ](name='Rule', description='Backup plan rules.'),
  schedule?: string(name='Schedule', description='Backup policy. Optional format: `I|{startTime}|{interval}`. This indicates that a backup task will be executed every `{interval}` starting from `{startTime}`. It does not compensate for missed backup tasks due to past time. If the previous backup task has not been completed, the next backup task will not be triggered. For example, `I|1631685600|P1D` means a backup is performed every day starting from 2021-09-15 14:00:00.

- **startTime**: Start time of the backup, in UNIX timestamp, in seconds.
- **interval**: ISO8601 time interval. For example, PT1H indicates an interval of one hour, and P1D indicates an interval of one day.

This parameter is required.', example='I|1602673264|P1D'),
  sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **ECS_FILE**: Elastic Compute Service (ECS) files
*   **OSS**: Object Storage Service (OSS) buckets
*   **NAS**: File Storage NAS (NAS) file systems
*   **OTS**: Tablestore instances
*   **UDM_ECS**: ECS instances
*   **SYNC**: data synchronization

This parameter is required.', example='ECS_FILE'),
  speedLimit?: string(name='SpeedLimit', description='This parameter is required when **SourceType** is set to **ECS_FILE**. It represents the backup traffic control. Format: `{start}:{end}:{bandwidth}`. Multiple traffic control configurations are separated by |, and the configured times should not overlap.

- **start**: Start hour.
- **end**: End hour.
- **bandwidth**: Limit rate, in KB/s.', example='0:24:5120'),
  udmRegionId?: string(name='UdmRegionId', description='Region where the whole machine backup instance is located.', example='cn-shanghai'),
  vaultId?: string(name='VaultId', description='Backup vault ID.', example='v-0006******q'),
}

model CreateBackupPlanShrinkRequest {
  backupType?: string(name='BackupType', description='Backup type. Value: **COMPLETE**, indicating a full backup.

This parameter is required.', example='COMPLETE'),
  bucket?: string(name='Bucket', description='This parameter is required when **SourceType** is set to **OSS**. It represents the OSS bucket name.', example='hbr-backup-oss'),
  changeListPath?: string(name='ChangeListPath', description='Configuration for the incremental file synchronization list. (Required only for synchronization)', example='{"dataSourceId": "ds-123456789", "path": "/changelist"}'),
  clusterId?: string(name='ClusterId', description='The ID of the client group that executes the data synchronization plan. This parameter is required only for data synchronization.', example='cl-***************'),
  createTime?: long(name='CreateTime', description='This parameter is required when **SourceType** is set to **NAS**. It represents the creation time of the file system, in UNIX timestamp, in seconds.', example='1607436917'),
  crossAccountRoleName?: string(name='CrossAccountRoleName', description='The role name created in the RAM of the original account for cross-account backup.', example='BackupRole'),
  crossAccountType?: string(name='CrossAccountType', description='Cross-account backup type. Supported values:
- SELF_ACCOUNT: Backup within the same account
- CROSS_ACCOUNT: Cross-account backup', example='CROSS_ACCOUNT'),
  crossAccountUserId?: long(name='CrossAccountUserId', description='The original account ID used for cross-account backup.', example='15897534xxxx4625'),
  dataSourceId?: string(name='DataSourceId', description='The ID of the data source. This parameter is required only for data synchronization.', example='ds-****************'),
  destDataSourceDetailShrink?: string(name='DestDataSourceDetail', description='Destination data source details. (Required only for synchronization)', example='{\\\\"prefix\\\\":\\\\"/\\\\"}'),
  destDataSourceId?: string(name='DestDataSourceId', description='Destination data source ID. (Required only for synchronization)', example='ds-*********************'),
  destSourceType?: string(name='DestSourceType', description='Destination data source type. (Required only for synchronization)', example='OSS'),
  detailShrink?: string(name='Detail', description='Details of the whole machine backup, in JSON string format.

* snapshotGroup: Whether to use a consistent snapshot group (only valid if all instance disks are ESSD).
* appConsistent: Whether to use application consistency (requires the use of preScriptPath and postScriptPath parameters).
* preScriptPath: Path to the freeze script.
* postScriptPath: Path to the thaw script.', example='{\\\\"EnableFsFreeze\\\\":true,\\\\"appConsistent\\\\":false,\\\\"postScriptPath\\\\":\\\\"\\\\",\\\\"preScriptPath\\\\":\\\\"\\\\",\\\\"snapshotGroup\\\\":true,\\\\"timeoutInSeconds\\\\":60}'),
  disabled?: boolean(name='Disabled', description='Is the plan disabled by default', example='true'),
  exclude?: string(name='Exclude', description='This parameter is required only when **SourceType** is set to **ECS_FILE**. It specifies the path that should not be backed up, meaning all files under this path will not be included in the backup. The maximum length is 255 characters.', example='["/var", "/proc"]'),
  fileSystemId?: string(name='FileSystemId', description='This parameter is required when **SourceType** is set to **NAS**. It represents the file system ID.', example='005494'),
  include?: string(name='Include', description='This parameter is required when **SourceType** is set to **ECS_FILE**. It represents the path to be backed up, and all files under this path will be backed up. Supports up to 255 characters.', example='["/home/alice/*.pdf", "/home/bob/*.txt"]'),
  instanceId?: string(name='InstanceId', description='This parameter is required when **SourceType** is set to **ECS_FILE**. It represents the ECS instance ID.', example='i-m5e*****6q'),
  instanceName?: string(name='InstanceName', description='Table store instance name.', example='instancename'),
  keepLatestSnapshots?: long(name='KeepLatestSnapshots', description='Whether to enable retaining at least one backup version.
- 0 - Do not retain
- 1 - Retain', example='1'),
  options?: string(name='Options', description='This parameter is required when **SourceType** is set to **ECS_FILE**. It indicates whether to use the Windows system VSS to define the backup path.

- This feature only supports Windows type ECS instances.
- If there are data changes in the backup source and you need to ensure consistency between the backup data and the source data, you can configure it as `["UseVSS":true]`.
- After choosing to use VSS, multiple file directories cannot be backed up simultaneously.', example='{"UseVSS":false}'),
  otsDetailShrink?: string(name='OtsDetail', description='The details about the Tablestore instance.'),
  path?: [ string ](name='Path', description='Backup paths.'),
  planName?: string(name='PlanName', description='Name of the backup plan. 1 to 64 characters. The name must be unique for each data source type within a single backup vault.

This parameter is required.', example='planname'),
  prefix?: string(name='Prefix', description='This parameter is required when **SourceType** is set to **OSS**. It represents the backup prefix. When specified, only objects matching the prefix are backed up.', example='oss-prefix'),
  retention?: long(name='Retention', description='Number of days to retain the backup, with a minimum value of 1, in days.', example='7'),
  rule?: [ 
    {
      backupType?: string(name='BackupType', description='Backup type.', example='COMPLETE'),
      destinationRegionId?: string(name='DestinationRegionId', description='ID of the region for offsite replication.', example='cn-hangzhou'),
      destinationRetention?: long(name='DestinationRetention', description='Number of days to retain offsite backups.', example='7'),
      disabled?: boolean(name='Disabled', description='Whether the rule is enabled.', example='true'),
      doCopy?: boolean(name='DoCopy', description='Whether to enable offsite replication.', example='true'),
      retention?: long(name='Retention', description='Backup retention period.', example='7'),
      ruleName?: string(name='RuleName', description='Rule name.', example='rule-test-name'),
      schedule?: string(name='Schedule', description='Backup strategy. Optional format: I|{startTime}|{interval}. This means that a backup task is executed every {interval} starting from {startTime}. Backup tasks for past times will not be executed. If the previous backup task has not been completed, the next backup task will not be triggered. For example, I|1631685600|P1D means a backup is performed every day starting from 2021-09-15 14:00:00.

- startTime: The start time of the backup, in UNIX time, in seconds.
- interval: ISO8601 time interval. For example, PT1H means an interval of one hour. P1D means an interval of one day.', example='I|1602673264|P1D'),
    }
  ](name='Rule', description='Backup plan rules.'),
  schedule?: string(name='Schedule', description='Backup policy. Optional format: `I|{startTime}|{interval}`. This indicates that a backup task will be executed every `{interval}` starting from `{startTime}`. It does not compensate for missed backup tasks due to past time. If the previous backup task has not been completed, the next backup task will not be triggered. For example, `I|1631685600|P1D` means a backup is performed every day starting from 2021-09-15 14:00:00.

- **startTime**: Start time of the backup, in UNIX timestamp, in seconds.
- **interval**: ISO8601 time interval. For example, PT1H indicates an interval of one hour, and P1D indicates an interval of one day.

This parameter is required.', example='I|1602673264|P1D'),
  sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **ECS_FILE**: Elastic Compute Service (ECS) files
*   **OSS**: Object Storage Service (OSS) buckets
*   **NAS**: File Storage NAS (NAS) file systems
*   **OTS**: Tablestore instances
*   **UDM_ECS**: ECS instances
*   **SYNC**: data synchronization

This parameter is required.', example='ECS_FILE'),
  speedLimit?: string(name='SpeedLimit', description='This parameter is required when **SourceType** is set to **ECS_FILE**. It represents the backup traffic control. Format: `{start}:{end}:{bandwidth}`. Multiple traffic control configurations are separated by |, and the configured times should not overlap.

- **start**: Start hour.
- **end**: End hour.
- **bandwidth**: Limit rate, in KB/s.', example='0:24:5120'),
  udmRegionId?: string(name='UdmRegionId', description='Region where the whole machine backup instance is located.', example='cn-shanghai'),
  vaultId?: string(name='VaultId', description='Backup vault ID.', example='v-0006******q'),
}

model CreateBackupPlanResponseBody = {
  code?: string(name='Code', description='Return code, 200 indicates success.', example='200'),
  message?: string(name='Message', description='Description of the return message, usually returns \\\\"successful\\\\" upon success, and corresponding error messages in case of failure.', example='successful'),
  planId?: string(name='PlanId', description='Backup plan ID.', example='plan-*********************'),
  requestId?: string(name='RequestId', description='Request ID.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Whether the request was successful.

- true: Success.
- false: Failure.', example='true'),
}

model CreateBackupPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateBackupPlanResponseBody(name='body'),
}

/**
 * @summary Create a backup plan.
 *
 * @description - A backup plan associates data sources with backup policies and other necessary information for backups. After the execution of a backup plan, it generates a backup task that records the progress and results of the backup. If the backup task is successful, a backup snapshot is created. You can use the backup snapshot to create a recovery task.
 * - A backup plan supports only one type of data source.
 * - A backup plan supports only a single fixed interval backup cycle strategy.
 * - A backup plan can back up to only one backup vault.
 *
 * @param tmpReq CreateBackupPlanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateBackupPlanResponse
 */
async function createBackupPlanWithOptions(tmpReq: CreateBackupPlanRequest, runtime: Util.RuntimeOptions): CreateBackupPlanResponse {
  Util.validateModel(tmpReq);
  var request = new CreateBackupPlanShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.destDataSourceDetail)) {
    request.destDataSourceDetailShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.destDataSourceDetail, 'DestDataSourceDetail', 'json');
  }
  if (!Util.isUnset(tmpReq.detail)) {
    request.detailShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.detail, 'Detail', 'json');
  }
  if (!Util.isUnset(tmpReq.otsDetail)) {
    request.otsDetailShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.otsDetail, 'OtsDetail', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.backupType)) {
    query['BackupType'] = request.backupType;
  }
  if (!Util.isUnset(request.bucket)) {
    query['Bucket'] = request.bucket;
  }
  if (!Util.isUnset(request.changeListPath)) {
    query['ChangeListPath'] = request.changeListPath;
  }
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.createTime)) {
    query['CreateTime'] = request.createTime;
  }
  if (!Util.isUnset(request.crossAccountRoleName)) {
    query['CrossAccountRoleName'] = request.crossAccountRoleName;
  }
  if (!Util.isUnset(request.crossAccountType)) {
    query['CrossAccountType'] = request.crossAccountType;
  }
  if (!Util.isUnset(request.crossAccountUserId)) {
    query['CrossAccountUserId'] = request.crossAccountUserId;
  }
  if (!Util.isUnset(request.destDataSourceDetailShrink)) {
    query['DestDataSourceDetail'] = request.destDataSourceDetailShrink;
  }
  if (!Util.isUnset(request.destDataSourceId)) {
    query['DestDataSourceId'] = request.destDataSourceId;
  }
  if (!Util.isUnset(request.destSourceType)) {
    query['DestSourceType'] = request.destSourceType;
  }
  if (!Util.isUnset(request.detailShrink)) {
    query['Detail'] = request.detailShrink;
  }
  if (!Util.isUnset(request.disabled)) {
    query['Disabled'] = request.disabled;
  }
  if (!Util.isUnset(request.fileSystemId)) {
    query['FileSystemId'] = request.fileSystemId;
  }
  if (!Util.isUnset(request.keepLatestSnapshots)) {
    query['KeepLatestSnapshots'] = request.keepLatestSnapshots;
  }
  if (!Util.isUnset(request.planName)) {
    query['PlanName'] = request.planName;
  }
  if (!Util.isUnset(request.prefix)) {
    query['Prefix'] = request.prefix;
  }
  if (!Util.isUnset(request.retention)) {
    query['Retention'] = request.retention;
  }
  if (!Util.isUnset(request.schedule)) {
    query['Schedule'] = request.schedule;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  if (!Util.isUnset(request.udmRegionId)) {
    query['UdmRegionId'] = request.udmRegionId;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.dataSourceId)) {
    body['DataSourceId'] = request.dataSourceId;
  }
  if (!Util.isUnset(request.exclude)) {
    body['Exclude'] = request.exclude;
  }
  if (!Util.isUnset(request.include)) {
    body['Include'] = request.include;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.instanceName)) {
    body['InstanceName'] = request.instanceName;
  }
  if (!Util.isUnset(request.options)) {
    body['Options'] = request.options;
  }
  if (!Util.isUnset(request.otsDetailShrink)) {
    body['OtsDetail'] = request.otsDetailShrink;
  }
  if (!Util.isUnset(request.path)) {
    body['Path'] = request.path;
  }
  if (!Util.isUnset(request.rule)) {
    body['Rule'] = request.rule;
  }
  if (!Util.isUnset(request.speedLimit)) {
    body['SpeedLimit'] = request.speedLimit;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateBackupPlan',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Create a backup plan.
 *
 * @description - A backup plan associates data sources with backup policies and other necessary information for backups. After the execution of a backup plan, it generates a backup task that records the progress and results of the backup. If the backup task is successful, a backup snapshot is created. You can use the backup snapshot to create a recovery task.
 * - A backup plan supports only one type of data source.
 * - A backup plan supports only a single fixed interval backup cycle strategy.
 * - A backup plan can back up to only one backup vault.
 *
 * @param request CreateBackupPlanRequest
 * @return CreateBackupPlanResponse
 */
async function createBackupPlan(request: CreateBackupPlanRequest): CreateBackupPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return createBackupPlanWithOptions(request, runtime);
}

model CreateClientsRequest {
  alertSetting?: string(name='AlertSetting', description='The alert settings. Valid value: INHERITED, which indicates that the HBR client sends alert notifications by using the same method configured for the backup vault.', example='INHERITED'),
  clientInfo?: string(name='ClientInfo', description='The installation information of the HBR clients.', example='[  {    "instanceId": "i-bp116lr******te9q2",    "accessKeyId": "",    "accessKeySecret": "",    "clusterId": "cl-000csy09q******9rfz9",    "sourceTypes": [      "HANA"    ]  },  {    "instanceId": "i-bp116lrux******hte9q4",    "accessKeyId": "",    "accessKeySecret": "",    "clusterId": "cl-000csy09q5094vw9rfz9",    "sourceTypes": [      "HANA"    ]  }]'),
  crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the Resource Access Management (RAM) role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='hbrcrossrole'),
  crossAccountType?: string(name='CrossAccountType', description='The backup type. Valid values:

- **SELF_ACCOUNT**: Data is backed up within the same Alibaba Cloud account.
- **CROSS_ACCOUNT**: Data is backed up across Alibaba Cloud accounts.', example='CROSS_ACCOUNT'),
  crossAccountUserId?: long(name='CrossAccountUserId', description='The ID of the source Alibaba Cloud account that authorizes the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='158975xxxxx4625'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-aekzvx7d3c4kpny'),
  useHttps?: boolean(name='UseHttps', description='Specifies whether to transmit data over HTTPS. Valid values:

*   true: transmits data over HTTPS.
*   false: transmits data over HTTP.', example='false'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.

This parameter is required.', example='v-0001ufe******kgm'),
}

model CreateClientsResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  instanceStatuses?: {
    instanceStatus?: [ 
    {
      instanceId?: string(name='InstanceId', description='The ID of the ECS instance.', example='i-2zegp3cdu******uj9i'),
      validInstance?: boolean(name='ValidInstance', description='Indicates whether an HBR client can be installed on the ECS instance. Valid values:

*   true: An HBR client can be installed on the ECS instance.
*   false: An HBR client cannot be installed on the ECS instance.', example='true'),
    }
  ](name='InstanceStatus')
  }(name='InstanceStatuses', description='The status of the ECS instance. If you specify more than one instance IDs in the request and the status of an ECS instance does not meet the requirements to install an HBR client, an error message is returned based on the value of this parameter.'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4A8A9AE4-F798-5E6D-853E-10F9F5A1BD4E'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
  taskId?: string(name='TaskId', description='The ID of the asynchronous job. You can call the DescribeTask operation to query the execution result of an asynchronous job.', example='t-000h9x5t02vhyksf1x7k'),
}

model CreateClientsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateClientsResponseBody(name='body'),
}

/**
 * @summary Installs one or more Cloud Backup clients on specified instances.
 *
 * @description Before you call this operation, make sure that you fully understand the billing methods and pricing of Cloud Backup. For more information, see [Billing methods and billable items](https://help.aliyun.com/document_detail/89062.html).
 *
 * @param request CreateClientsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateClientsResponse
 */
async function createClientsWithOptions(request: CreateClientsRequest, runtime: Util.RuntimeOptions): CreateClientsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.alertSetting)) {
    query['AlertSetting'] = request.alertSetting;
  }
  if (!Util.isUnset(request.clientInfo)) {
    query['ClientInfo'] = request.clientInfo;
  }
  if (!Util.isUnset(request.crossAccountRoleName)) {
    query['CrossAccountRoleName'] = request.crossAccountRoleName;
  }
  if (!Util.isUnset(request.crossAccountType)) {
    query['CrossAccountType'] = request.crossAccountType;
  }
  if (!Util.isUnset(request.crossAccountUserId)) {
    query['CrossAccountUserId'] = request.crossAccountUserId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.useHttps)) {
    query['UseHttps'] = request.useHttps;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateClients',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Installs one or more Cloud Backup clients on specified instances.
 *
 * @description Before you call this operation, make sure that you fully understand the billing methods and pricing of Cloud Backup. For more information, see [Billing methods and billable items](https://help.aliyun.com/document_detail/89062.html).
 *
 * @param request CreateClientsRequest
 * @return CreateClientsResponse
 */
async function createClients(request: CreateClientsRequest): CreateClientsResponse {
  var runtime = new Util.RuntimeOptions{};
  return createClientsWithOptions(request, runtime);
}

model CreateHanaBackupPlanRequest {
  backupPrefix?: string(name='BackupPrefix', description='The backup prefix.', example='DIFF_DATA_BACKUP'),
  backupType?: string(name='BackupType', description='The backup type. Valid values:

*   COMPLETE: full backup
*   INCREMENTAL: incremental backup
*   DIFFERENTIAL: differential backup

This parameter is required.', example='COMPLETE'),
  clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance.

This parameter is required.', example='cl-00024vyjj9******v'),
  databaseName?: string(name='DatabaseName', description='The name of the database.

This parameter is required.', example='SYSTEMDB'),
  planName?: string(name='PlanName', description='The name of the backup plan.

This parameter is required.', example='plan-20220110-113108'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmvnf22m7itha'),
  schedule?: string(name='Schedule', description='The backup policy. Format: `I|{startTime}|{interval}`. The system runs the first backup job at a point in time that is specified in the {startTime} parameter and the subsequent backup jobs at an interval that is specified in the {interval} parameter. The system does not run a backup job before the specified point in time. Each backup job, except the first one, starts only after the previous backup job is completed. For example, `I|1631685600|P1D` specifies that the system runs the first backup job at 14:00:00 on September 15, 2021 and the subsequent backup jobs once a day.

*   startTime: the time at which the system starts to run a backup job. The time must follow the UNIX time format. Unit: seconds.
*   interval: the interval at which the system runs a backup job. The interval must follow the ISO 8601 standard. For example, PT1H specifies an interval of one hour. P1D specifies an interval of one day.

This parameter is required.', example='I|1602673264|P1D'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.

This parameter is required.', example='v-0002pcwhdn******wmi'),
}

model CreateHanaBackupPlanResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  planId?: string(name='PlanId', description='The ID of the backup plan.', example='pl-000756jdlk2zmqig2nea'),
  requestId?: string(name='RequestId', description='The request ID.', example='33AA3AAE-89E1-5D3A-A51D-0C0A80850F68'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model CreateHanaBackupPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateHanaBackupPlanResponseBody(name='body'),
}

/**
 * @summary Creates a backup plan for an SAP HANA instance.
 *
 * @description *   A backup plan defines the data source, backup policy, and other configurations. After you execute a backup plan, a backup job is generated to record the backup progress and the backup result. If a backup job is completed, a backup snapshot is generated. You can use a backup snapshot to create a restore job.
 * *   You can specify only one type of data source in a backup plan.
 * *   You can specify only one interval as a backup cycle in a backup plan.
 * *   Each backup plan allows you to back up data to only one backup vault.
 *
 * @param request CreateHanaBackupPlanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateHanaBackupPlanResponse
 */
async function createHanaBackupPlanWithOptions(request: CreateHanaBackupPlanRequest, runtime: Util.RuntimeOptions): CreateHanaBackupPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.backupPrefix)) {
    query['BackupPrefix'] = request.backupPrefix;
  }
  if (!Util.isUnset(request.backupType)) {
    query['BackupType'] = request.backupType;
  }
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.databaseName)) {
    query['DatabaseName'] = request.databaseName;
  }
  if (!Util.isUnset(request.planName)) {
    query['PlanName'] = request.planName;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.schedule)) {
    query['Schedule'] = request.schedule;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateHanaBackupPlan',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a backup plan for an SAP HANA instance.
 *
 * @description *   A backup plan defines the data source, backup policy, and other configurations. After you execute a backup plan, a backup job is generated to record the backup progress and the backup result. If a backup job is completed, a backup snapshot is generated. You can use a backup snapshot to create a restore job.
 * *   You can specify only one type of data source in a backup plan.
 * *   You can specify only one interval as a backup cycle in a backup plan.
 * *   Each backup plan allows you to back up data to only one backup vault.
 *
 * @param request CreateHanaBackupPlanRequest
 * @return CreateHanaBackupPlanResponse
 */
async function createHanaBackupPlan(request: CreateHanaBackupPlanRequest): CreateHanaBackupPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return createHanaBackupPlanWithOptions(request, runtime);
}

model CreateHanaInstanceRequest {
  alertSetting?: string(name='AlertSetting', description='The alert settings. Valid value: INHERITED, which indicates that the Cloud Backup client sends alert notifications by using the same method configured for the backup vault.', example='INHERITED'),
  crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the Resource Access Management (RAM) role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='hbrcrossrole'),
  crossAccountType?: string(name='CrossAccountType', description='The backup type. Valid values:

- **SELF_ACCOUNT**: Data is backed up within the same Alibaba Cloud account.
- **CROSS_ACCOUNT**: Data is backed up across Alibaba Cloud accounts.', example='CROSS_ACCOUNT'),
  crossAccountUserId?: long(name='CrossAccountUserId', description='The ID of the source Alibaba Cloud account that authorizes the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='158975xxxxx4625'),
  ecsInstanceId?: string(name='EcsInstanceId', description='The IDs of the ECS instances that host the SAP HANA instance to be registered. Cloud Backup installs backup clients on the specified ECS instances.', example='[\\\\"i-uf6ir9y******hvisj\\\\"]'),
  hanaName?: string(name='HanaName', description='The name of the SAP HANA instance.', example='HANA-DEV'),
  host?: string(name='Host', description='The private or internal IP address of the host where the primary node of the SAP HANA instance resides.', example='47.100.XX.XX'),
  instanceNumber?: int32(name='InstanceNumber', description='The instance number of the SAP HANA system.', example='00'),
  password?: string(name='Password', description='The password that is used to connect with the SAP HANA database.', example='************'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfm4ebtpkzx7zy'),
  sid?: string(name='Sid', description='The security identifier (SID) of the SAP HANA database. For more information, see [How to find sid user and instance number of HANA db?](https://answers.sap.com/questions/555192/how-to-find-sid-user-and-instance-number-of-hana-d.html?spm=a2c4g.11186623.0.0.55c34b4ftZeXNK).', example='HXE'),
  useSsl?: boolean(name='UseSsl', description='Specifies whether to connect with the SAP HANA database over Secure Sockets Layer (SSL).', example='true'),
  userName?: string(name='UserName', description='The username of the SYSTEMDB database.', example='admin'),
  validateCertificate?: boolean(name='ValidateCertificate', description='Specifies whether to verify the SSL certificate of the SAP HANA database.', example='false'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.

This parameter is required.', example='v-0003v4a******gfv2'),
}

model CreateHanaInstanceResponseBody = {
  clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance.', example='cl-000dp1sz******6hn'),
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='EB526A5D-1FE2-51C1-B790-1732C1DBA969'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model CreateHanaInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateHanaInstanceResponseBody(name='body'),
}

/**
 * @summary Registers an SAP HANA instance.
 *
 * @description To register an SAP HANA instance, you must configure the SAP HANA connection information. After the SAP HANA instance is registered, Cloud Backup installs a backup client on the node of the SAP HANA instance.
 *
 * @param request CreateHanaInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateHanaInstanceResponse
 */
async function createHanaInstanceWithOptions(request: CreateHanaInstanceRequest, runtime: Util.RuntimeOptions): CreateHanaInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.alertSetting)) {
    query['AlertSetting'] = request.alertSetting;
  }
  if (!Util.isUnset(request.crossAccountRoleName)) {
    query['CrossAccountRoleName'] = request.crossAccountRoleName;
  }
  if (!Util.isUnset(request.crossAccountType)) {
    query['CrossAccountType'] = request.crossAccountType;
  }
  if (!Util.isUnset(request.crossAccountUserId)) {
    query['CrossAccountUserId'] = request.crossAccountUserId;
  }
  if (!Util.isUnset(request.ecsInstanceId)) {
    query['EcsInstanceId'] = request.ecsInstanceId;
  }
  if (!Util.isUnset(request.hanaName)) {
    query['HanaName'] = request.hanaName;
  }
  if (!Util.isUnset(request.host)) {
    query['Host'] = request.host;
  }
  if (!Util.isUnset(request.instanceNumber)) {
    query['InstanceNumber'] = request.instanceNumber;
  }
  if (!Util.isUnset(request.password)) {
    query['Password'] = request.password;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sid)) {
    query['Sid'] = request.sid;
  }
  if (!Util.isUnset(request.useSsl)) {
    query['UseSsl'] = request.useSsl;
  }
  if (!Util.isUnset(request.userName)) {
    query['UserName'] = request.userName;
  }
  if (!Util.isUnset(request.validateCertificate)) {
    query['ValidateCertificate'] = request.validateCertificate;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateHanaInstance',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Registers an SAP HANA instance.
 *
 * @description To register an SAP HANA instance, you must configure the SAP HANA connection information. After the SAP HANA instance is registered, Cloud Backup installs a backup client on the node of the SAP HANA instance.
 *
 * @param request CreateHanaInstanceRequest
 * @return CreateHanaInstanceResponse
 */
async function createHanaInstance(request: CreateHanaInstanceRequest): CreateHanaInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createHanaInstanceWithOptions(request, runtime);
}

model CreateHanaRestoreRequest {
  backupId?: long(name='BackupId', description='The ID of the backup.', example='1645628400235'),
  backupPrefix?: string(name='BackupPrefix', description='The backup prefix.

This parameter is required.', example='COMPLETE_DATA_BACKUP_2022_05_02_15_39'),
  checkAccess?: boolean(name='CheckAccess', description='Specifies whether to validate the differential backup and log backup. Valid values: true and false. If you set the value to true, HBR checks whether the required differential backup and log backup are available before the restore job starts. If the differential backup or log backup is unavailable, HBR does not start the restore job.', example='false'),
  clearLog?: boolean(name='ClearLog', description='Specifies whether to delete all log entries from the log area after the log entries are restored. Valid values: true and false. If you set the value to false, all log entries are deleted from the log area after the log entries are restored.', example='false'),
  clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance that you want to restore.

This parameter is required.', example='cl-000fbrs5******ka9w'),
  databaseName?: string(name='DatabaseName', description='The name of the database that you want to restore.

This parameter is required.', example='TS2'),
  logPosition?: long(name='LogPosition', description='The log position to which you want to restore the database. This parameter is valid only if you set the Mode parameter to **RECOVERY_TO_LOG_POSITION**.', example='0'),
  masterClientId?: string(name='MasterClientId', description='The ID of the client where the primary node of the SAP HANA resides.', example='c-000ii8tzv**********'),
  mode?: string(name='Mode', description='The recovery mode. Valid values:

*   **RECOVERY_TO_MOST_RECENT**: restores the database to the recently available state to which the database has been backed up.
*   **RECOVERY_TO_POINT_IN_TIME**: restores the database to a specified point in time.
*   **RECOVERY_TO_SPECIFIC_BACKUP**: restores the database to a specified backup.
*   **RECOVERY_TO_LOG_POSITION**: restores the database to a specified log position.

This parameter is required.', example='RECOVERY_TO_POINT_IN_TIME'),
  recoveryPointInTime?: long(name='RecoveryPointInTime', description='The point in time to which you want to restore the database. This parameter is valid only if you set the Mode parameter to **RECOVERY_TO_POINT_IN_TIME**. HBR restores the database to a state closest to the specified point in time.', example='1635315505'),
  sidAdmin?: string(name='SidAdmin', description='The SID admin account that is created by SAP HANA.', example='DB'),
  source?: string(name='Source', description='The name of the source system. This parameter specifies the name of the source database that you want to restore. You must set the parameter in the `<Source database name>@SID` format.', example='HNP@HNP'),
  sourceClusterId?: string(name='SourceClusterId', description='The ID of the source SAP HANA instance.', example='cl-000ii8tzv******xm0t'),
  systemCopy?: boolean(name='SystemCopy', description='Specifies whether to restore the database to a different instance.', example='false'),
  useCatalog?: boolean(name='UseCatalog', description='Specifies whether to use a catalog backup to restore the database. This parameter is required only if you set the Mode parameter to **RECOVERY_TO_SPECIFIC_BACKUP**. If you turn off Use Catalog, you must specify the prefix of a backup file. Then, Cloud Backup finds the backup file based on the specified prefix and restores the backup file.', example='false'),
  useDelta?: boolean(name='UseDelta', description='Specifies whether to use a differential backup or an incremental backup to restore the database. Valid values: true and false. If you want to use a differential backup or an incremental backup to restore the database, set the value to true. If you set the value to false, HBR uses a log backup to restore the database.', example='true'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-000************yqr'),
  volumeId?: int32(name='VolumeId', description='The ID of the volume that you want to restore. This parameter is valid only if you set the Mode parameter to **RECOVERY_TO_LOG_POSITION**.', example='0'),
}

model CreateHanaRestoreResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EEC65C22-2152-5E31-8AD6-D6CBF1BFF49F'),
  restoreId?: string(name='RestoreId', description='The ID of the restore job.', example='hr-000fb9bz190p1rse6jwv'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
}

model CreateHanaRestoreResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateHanaRestoreResponseBody(name='body'),
}

/**
 * @summary Creates a restore job for an SAP HANA database.
 *
 * @description If you call this operation to restore a database, the database is restored to a specified state. Proceed with caution. For more information, see [Restore databases to an SAP HANA instance](https://help.aliyun.com/document_detail/101178.html).
 *
 * @param request CreateHanaRestoreRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateHanaRestoreResponse
 */
async function createHanaRestoreWithOptions(request: CreateHanaRestoreRequest, runtime: Util.RuntimeOptions): CreateHanaRestoreResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.backupId)) {
    query['BackupId'] = request.backupId;
  }
  if (!Util.isUnset(request.backupPrefix)) {
    query['BackupPrefix'] = request.backupPrefix;
  }
  if (!Util.isUnset(request.checkAccess)) {
    query['CheckAccess'] = request.checkAccess;
  }
  if (!Util.isUnset(request.clearLog)) {
    query['ClearLog'] = request.clearLog;
  }
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.databaseName)) {
    query['DatabaseName'] = request.databaseName;
  }
  if (!Util.isUnset(request.logPosition)) {
    query['LogPosition'] = request.logPosition;
  }
  if (!Util.isUnset(request.masterClientId)) {
    query['MasterClientId'] = request.masterClientId;
  }
  if (!Util.isUnset(request.mode)) {
    query['Mode'] = request.mode;
  }
  if (!Util.isUnset(request.recoveryPointInTime)) {
    query['RecoveryPointInTime'] = request.recoveryPointInTime;
  }
  if (!Util.isUnset(request.sidAdmin)) {
    query['SidAdmin'] = request.sidAdmin;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  if (!Util.isUnset(request.sourceClusterId)) {
    query['SourceClusterId'] = request.sourceClusterId;
  }
  if (!Util.isUnset(request.systemCopy)) {
    query['SystemCopy'] = request.systemCopy;
  }
  if (!Util.isUnset(request.useCatalog)) {
    query['UseCatalog'] = request.useCatalog;
  }
  if (!Util.isUnset(request.useDelta)) {
    query['UseDelta'] = request.useDelta;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  if (!Util.isUnset(request.volumeId)) {
    query['VolumeId'] = request.volumeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateHanaRestore',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a restore job for an SAP HANA database.
 *
 * @description If you call this operation to restore a database, the database is restored to a specified state. Proceed with caution. For more information, see [Restore databases to an SAP HANA instance](https://help.aliyun.com/document_detail/101178.html).
 *
 * @param request CreateHanaRestoreRequest
 * @return CreateHanaRestoreResponse
 */
async function createHanaRestore(request: CreateHanaRestoreRequest): CreateHanaRestoreResponse {
  var runtime = new Util.RuntimeOptions{};
  return createHanaRestoreWithOptions(request, runtime);
}

model CreatePolicyBindingsRequest {
  policyBindingList?: [ 
    {
      advancedOptions?: {
        commonFileSystemDetail?: {
          fetchSliceSize?: long(name='FetchSliceSize', description='The size of backup shards (the number of files).', example='100000'),
          fullOnIncrementFail?: boolean(name='FullOnIncrementFail', description='Specifies whether the system performs full backup if incremental backup fails. Valid values:

*   **true**: The system performs full backup if incremental backup fails.
*   **false**: The system does not perform full backup if incremental backup fails.', example='true'),
        }(name='CommonFileSystemDetail', description='The advanced options for CPFS backup.'),
        commonNasDetail?: {
          clusterId?: string(name='ClusterId', description='The ID of the backup client group. When you perform on-premises NAS backup, Cloud Backup selects clients from the specified backup client group.', example='cl-000**************ggu'),
          fetchSliceSize?: long(name='FetchSliceSize', description='The size of backup shards (the number of files).', example='100000'),
          fullOnIncrementFail?: boolean(name='FullOnIncrementFail', description='Specifies whether the system performs full backup if incremental backup fails. Valid values:

*   **true**: The system performs full backup if incremental backup fails.
*   **false**: The system does not perform full backup if incremental backup fails.', example='true'),
        }(name='CommonNasDetail', description='The advanced options for on-premises NAS backup.'),
        fileDetail?: {
          advPolicy?: boolean(name='AdvPolicy', description='Specifies whether to use an advanced policy. Valid values:

*   **true**: uses the advanced policy.
*   **false**: does not use the advanced policy.', example='true'),
          useVSS?: boolean(name='UseVSS', description='Specifies whether to enable the Volume Shadow Copy Service (VSS) feature. Valid values:

*   **true**: enables the feature.
*   **false**: disables the feature.', example='true'),
        }(name='FileDetail', description='The advanced options for file backup.'),
        ossDetail?: {
          ignoreArchiveObject?: boolean(name='IgnoreArchiveObject', description='Do not prompt for archival type objects in task statistics and failed file lists.', example='true'),
          inventoryCleanupPolicy?: string(name='InventoryCleanupPolicy', description='Specifies whether the system deletes the inventory lists when a backup is completed. This parameter is valid only when OSS inventories are used. Valid values:

*   **NO_CLEANUP**: does not delete inventory lists.
*   **DELETE_CURRENT**: deletes the current inventory list.
*   **DELETE_CURRENT_AND_PREVIOUS**: deletes all inventory lists.', example='NO_CLEANUP'),
          inventoryId?: string(name='InventoryId', description='The name of the OSS inventory. If this parameter is not empty, the OSS inventory is used for performance optimization.

*   If you want to back up more than 100 million OSS objects, we recommend that you use inventory lists to accelerate incremental backup. Storage fees for inventory lists are included into your OSS bills.
*   A certain amount of time is required for OSS to generate inventory lists. Before inventory lists are generated, OSS objects may fail to be backed up. In this case, you can back up the OSS objects in the next backup cycle.', example='oss-inventory-default'),
        }(name='OssDetail', description='The advanced options for Object Storage Service (OSS) backup.'),
        udmDetail?: {
          appConsistent?: boolean(name='AppConsistent', description='Specifies whether to enable application consistency. You can enable application consistency only if all disks are ESSDs.', example='false'),
          diskIdList?: [ string ](name='DiskIdList', description='The IDs of the disks that need to be protected. If all disks need to be protected, this parameter is empty.'),
          enableFsFreeze?: boolean(name='EnableFsFreeze', description='This parameter is required only if you set the **AppConsistent** parameter to **true**. This parameter specifies whether to enable Linux fsfreeze to put file systems into the read-only state before application-consistent snapshots are created. Default value: true.', example='true'),
          enableWriters?: boolean(name='EnableWriters', description='This parameter is required only if you set the **AppConsistent** parameter to **true**. This parameter specifies whether to create application-consistent snapshots. Valid values:

*   true: creates application-consistent snapshots.
*   false: creates file system-consistent snapshots.

Default value: true.', example='true'),
          excludeDiskIdList?: [ string ](name='ExcludeDiskIdList', description='The IDs of the disks that do not need to be protected. If the DiskIdList parameter is not empty, this parameter is ignored.'),
          postScriptPath?: string(name='PostScriptPath', description='This parameter is required only if you set the **AppConsistent** parameter to **true**. This parameter specifies the path of the post-thaw scripts that are executed after application-consistent snapshots are created.', example='/tmp/postscript.sh'),
          preScriptPath?: string(name='PreScriptPath', description='This parameter is required only if you set the **AppConsistent** parameter to **true**. This parameter specifies the path of the pre-freeze scripts that are executed before application-consistent snapshots are created.', example='/tmp/prescript.sh'),
          ramRoleName?: string(name='RamRoleName', description='This parameter is required only if you set the **AppConsistent** parameter to **true**. This parameter specifies the name of the Resource Access Management (RAM) role that is required to create application-consistent snapshots.', example='AliyunECSInstanceForHbrRole'),
          snapshotGroup?: boolean(name='SnapshotGroup', description='Specifies whether to create a snapshot-consistent group. You can create a snapshot-consistent group only if all disks are Enterprise SSDs (ESSDs).', example='true'),
          timeoutInSeconds?: long(name='TimeoutInSeconds', description='This parameter is required only if you set the **AppConsistent** parameter to **true**. This parameter specifies the I/O freeze timeout period. Default value: 30. Unit: seconds.', example='30'),
        }(name='UdmDetail', description='The advanced options for ECS instance backup.'),
      }(name='AdvancedOptions', description='The advanced options.'),
      crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the RAM role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='hbrcrossrole'),
      crossAccountType?: string(name='CrossAccountType', description='Specifies whether to back up and restore data within the same Alibaba Cloud account or across Alibaba Cloud accounts. Default value: SELF_ACCOUNT. Valid values:

*   **SELF_ACCOUNT**: backs up data within the same Alibaba Cloud account.
*   **CROSS_ACCOUNT**: backs up data across Alibaba Cloud accounts.', example='SELF_ACCOUNT'),
      crossAccountUserId?: long(name='CrossAccountUserId', description='The ID of the source Alibaba Cloud account that authorizes the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='144**********732'),
      dataSourceId?: string(name='DataSourceId', description='The ID of the data source. The meaning of this parameter depends on the **SourceType** parameter. Valid values:

*   **UDM_ECS**: the ID of the Elastic Compute Service (ECS) instance
*   **OSS**: the name of the Object Storage Service (OSS) bucket
*   **NAS**: the ID of the File Storage NAS (NAS) file system
*   **COMMON_NAS**: the ID of the on-premises NAS file system
*   **ECS_FILE**: the ID of the ECS instance
*   **File**: the ID of the Cloud Backup client
*   **COMMON_FILE_SYSTEM**: the ID of the Cloud Parallel File Storage (CPFS) backup data source', example='i-bp1************dl8'),
      disabled?: string(name='Disabled', description='Specifies whether to disable the backup policy for the data source. Valid values:

*   true: disables the backup policy for the data source
*   false: enables the backup policy for the data source', example='true'),
      exclude?: string(name='Exclude', description='This parameter is required only if you set the **SourceType** parameter to **ECS_FILE**, **File**, **NAS**, **COMMON_NAS**, or **COMMON_FILE_SYSTEM**. This parameter specifies the type of files that do not need to be backed up. No files of the specified type are backed up. The value can be up to 255 characters in length.', example='[\\\\"*.doc\\\\",\\\\"*.xltm\\\\"]'),
      include?: string(name='Include', description='This parameter is required only if you set the **SourceType** parameter to **ECS_FILE**, **File**, **NAS**, **COMMON_NAS**, or **COMMON_FILE_SYSTEM**. This parameter specifies the type of files to be backed up. All files of the specified type are backed up. The value can be up to 255 characters in length.', example='[\\\\"*.doc\\\\",\\\\"*.xltm\\\\"]'),
      policyBindingDescription?: string(name='PolicyBindingDescription', description='The description of the association.', example='Bind data sources to a backup policy'),
      source?: string(name='Source', description='*   If the SourceType parameter is set to **OSS**, set the Source parameter to the prefix of the path to the folder that you want to back up. If you do not specify the Source parameter, the entire bucket (root directory) is backed up.
*   If the SourceType parameter is set to **ECS_FILE** or **File**, set the Source parameter to the path to the files that you want to back up. If you do not specify the Source parameter, all paths are backed up.
*   This parameter is required if the SourceType parameter is set to **COMMON_FILE_SYSTEM**. This parameter specifies the path to be backed up. To back up the /src path, enter ["/src"]. To back up the root path, enter ["/"].', example='backup/'),
      sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **UDM_ECS**: ECS instance
*   **OSS**: OSS bucket
*   **NAS**: NAS file system
*   **COMMON_NAS**: on-premises NAS file system
*   **ECS_FILE**: ECS file
*   **File**: on-premises file
*   **COMMON_FILE_SYSTEM**: CPFS file system', example='UDM_ECS'),
      speedLimit?: string(name='SpeedLimit', description='This parameter is required only if you set the **SourceType** parameter to **ECS_FILE** or **File**. This parameter specifies the throttling rules. Format: `{start}{end}{bandwidth}`. Separate multiple throttling rules with vertical bars (|). The time ranges of the throttling rules cannot overlap.

*   **start**: the start hour.
*   **end**: the end hour.
*   **bandwidth**: the bandwidth. Unit: KB/s.', example='0:24:1024'),
    }
  ](name='PolicyBindingList', description='The data sources that you want to bind to the backup policy.'),
  policyId?: string(name='PolicyId', description='The ID of the backup policy.', example='po-000************8ep'),
}

model CreatePolicyBindingsShrinkRequest {
  policyBindingListShrink?: string(name='PolicyBindingList', description='The data sources that you want to bind to the backup policy.'),
  policyId?: string(name='PolicyId', description='The ID of the backup policy.', example='po-000************8ep'),
}

model CreatePolicyBindingsResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='82CC5B6C-72F7-5D39-92F6-67887DF9AD46'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
}

model CreatePolicyBindingsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreatePolicyBindingsResponseBody(name='body'),
}

/**
 * @summary Binds one or more data sources to a backup policy.
 *
 * @description *   You can bind data sources to only one policy in each request.
 * *   Elastic Compute Service (ECS) instances can be bound to only one policy.
 *
 * @param tmpReq CreatePolicyBindingsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreatePolicyBindingsResponse
 */
async function createPolicyBindingsWithOptions(tmpReq: CreatePolicyBindingsRequest, runtime: Util.RuntimeOptions): CreatePolicyBindingsResponse {
  Util.validateModel(tmpReq);
  var request = new CreatePolicyBindingsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.policyBindingList)) {
    request.policyBindingListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.policyBindingList, 'PolicyBindingList', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.policyBindingListShrink)) {
    query['PolicyBindingList'] = request.policyBindingListShrink;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.policyId)) {
    body['PolicyId'] = request.policyId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreatePolicyBindings',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Binds one or more data sources to a backup policy.
 *
 * @description *   You can bind data sources to only one policy in each request.
 * *   Elastic Compute Service (ECS) instances can be bound to only one policy.
 *
 * @param request CreatePolicyBindingsRequest
 * @return CreatePolicyBindingsResponse
 */
async function createPolicyBindings(request: CreatePolicyBindingsRequest): CreatePolicyBindingsResponse {
  var runtime = new Util.RuntimeOptions{};
  return createPolicyBindingsWithOptions(request, runtime);
}

model CreatePolicyV2Request {
  policyDescription?: string(name='PolicyDescription', description='The description of the backup policy.', example='Data is backed up at 10:00:00 every day and replicated to the China (Shanghai) region for geo-redundancy.'),
  policyName?: string(name='PolicyName', description='The name of the backup policy.', example='Daily Local Backup + Remote Backup'),
  policyType?: string(name='PolicyType', description='The policy type. Valid values:

*   **STANDARD**: the general backup policy. This type of policy applies to backups other than Elastic Compute Service (ECS) instance backup.
*   **UDM_ECS_ONLY**: This type of policy applies only to ECS instance backup.

If the policy type is not specified, Cloud Backup automatically sets the policy type based on whether the backup vault is specified in the rules of the policy:

*   If the backup vault is specified, Cloud Backup sets the policy type to **STANDARD**.
*   If the backup vault is not specified, Cloud Backup sets the policy type to **UDM_ECS_ONLY**.', example='STANDARD'),
  rules?: [ 
    {
      backupType?: string(name='BackupType', description='This parameter is required only if the **RuleType** parameter is set to **BACKUP**. This parameter specifies the backup type. Valid value: **COMPLETE**, which indicates full backup.', example='COMPLETE'),
      dataSourceFilters?: [ 
        {
          dataSourceIds?: [ string ](name='DataSourceIds', description='This parameter is deprecated.'),
          sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **UDM_ECS**: Elastic Compute Service (ECS) instance This type of data source is supported only if the **PolicyType** parameter is set to **UDM_ECS_ONLY**.
*   **OSS**: Object Storage Service (OSS) bucket This type of data source is supported only if the **PolicyType** parameter is set to **STANDARD**.
*   **NAS**: File Storage NAS (NAS) file system This type of data source is supported only if the **PolicyType** parameter is set to **STANDARD**.
*   **ECS_FILE**: ECS file This type of data source is supported only if the **PolicyType** parameter is set to **STANDARD**.
*   **OTS**: Tablestore instance This type of data source is supported only if the **PolicyType** parameter is set to **STANDARD**.', example='UDM_ECS'),
        }
      ](name='DataSourceFilters', description='This parameter is required only if the **RuleType** parameter is set to **TAG**. This parameter specifies the data source filter rule.'),
      immutable?: boolean(name='Immutable', description='This parameter is required only if the **PolicyType** parameter is set to **UDM_ECS_ONLY**. This parameter specifies whether to enable the immutable backup feature.', example='true'),
      keepLatestSnapshots?: long(name='KeepLatestSnapshots', description='Specifies whether to enable the feature of keeping at least one backup version. Valid values:

*   0: The feature is disabled.
*   1: The feature is enabled.', example='1'),
      replicationRegionId?: string(name='ReplicationRegionId', description='This parameter is required only if the **RuleType** parameter is set to **REPLICATION**. This parameter specifies the ID of the destination region.', example='cn-shanghai'),
      retention?: long(name='Retention', description='This parameter is required only if the **RuleType** parameter is set to **BACKUP**, **TRANSITION**, or **REPLICATION**.

*   If the **RuleType** parameter is set to **BACKUP**, this parameter specifies the retention period of the backup data. The priority is lower than the retention period when the **RuleType** parameter is set to **TRANSITION**. Minimum value: 1. Maximum value: 364635. Unit: days.
*   If the **RuleType** parameter is set to **TRANSITION**, this parameter specifies the retention period of the backup data. Minimum value: 1. Maximum value: 364635. Unit: days.
*   If the **RuleType** parameter is set to **REPLICATION**, this parameter specifies the retention period of remote backups. Minimum value: 1. Maximum value: 364635. Unit: days.', example='7'),
      retentionRules?: [ 
        {
          advancedRetentionType?: string(name='AdvancedRetentionType', description='The type of the special retention rule. Valid values:

*   **DAILY**: retains daily backups
*   **WEEKLY**: retains weekly backups
*   **MONTHLY**: retains monthly backups
*   **YEARLY**: retains yearly backups', example='YEARLY'),
          retention?: long(name='Retention', description='The special retention period of backups. Minimum value: 1. Unit: days.', example='730'),
          whichSnapshot?: long(name='WhichSnapshot', description='Specifies which backup is retained based on the special retention rule. Only the first backup can be retained.', example='1'),
        }
      ](name='RetentionRules', description='This parameter is required only if the **RuleType** parameter is set to **TRANSITION**. This parameter specifies the special retention rules.'),
      ruleType?: string(name='RuleType', description='The type of the rule. Each backup policy must have at least one rule of the **BACKUP** type and only one rule of the **TRANSITION** type. Valid values:

*   **BACKUP**: backup rule
*   **TRANSITION**: lifecycle rule
*   **REPLICATION**: replication rule
*   **TAG**: tag-based resource association rule

This parameter is required.', example='BACKUP'),
      schedule?: string(name='Schedule', description='This parameter is required only if the **RuleType** parameter is set to **BACKUP**. This parameter specifies the backup schedule settings. Formats:

*   `I|{startTime}|{interval}`: The system runs the first backup job at a point in time that is specified in the {startTime} parameter and the subsequent backup jobs at an interval that is specified in the {interval} parameter. For example, `I|1631685600|P1D` indicates that the system runs the first backup job at 14:00:00 on September 15, 2021 and the subsequent backup jobs once a day.

    *   startTime: the time at which the system starts to run a backup job. The time must follow the UNIX time format. Unit: seconds.
    *   interval: the interval at which the system runs a backup job. The interval must follow the ISO 8601 standard. For example, `PT1H` specifies an interval of 1 hour. `P1D` specifies an interval of one day.

*   `C|{startTime}|{crontab}`: The system runs backup jobs at a point in time that is specified in the {startTime} parameter based on the {crontab} expression. For example, C|1631685600|0 0 2 ?\\\\* 3,5,7 indicates that the system runs backup jobs at 02:00:00 every Tuesday, Thursday, and Saturday from14:00:00 on September 15, 2021.``

    *   startTime: the time at which the system starts to run a backup job. The time must follow the UNIX time format. Unit: seconds.
    *   crontab: the crontab expression. For example, 0 0 2 ?\\\\* 3,5,7 indicates 02:00:00 every Tuesday, Thursday, and Saturday.``

The system does not run a backup job before the specified point in time. Each backup job, except the first one, starts only after the previous backup job is completed.', example='I|1648647166|P1D'),
      tagFilters?: [ 
        {
          key?: string(name='Key', description='The tag key.', example='env'),
          operator?: string(name='Operator', description='The tag-based matching rule. Valid values:

*   **EQUAL**: Both the tag key and tag value are matched.
*   **NOT**: The tag key is matched and the tag value is not matched.', example='EQUAL'),
          value?: string(name='Value', description='The tag value. If you leave this parameter empty, the value is any value.', example='prod'),
        }
      ](name='TagFilters', description='This parameter is required only if the **RuleType** parameter is set to **TAG**. This parameter specifies the resource tag filter rule.'),
      vaultId?: string(name='VaultId', description='This parameter is required only if the RuleType parameter is set to BACKUP. The ID of the backup vault.', example='v-0001************aseg'),
    }
  ](name='Rules', description='The rules in the backup policy.'),
}

model CreatePolicyV2ShrinkRequest {
  policyDescription?: string(name='PolicyDescription', description='The description of the backup policy.', example='Data is backed up at 10:00:00 every day and replicated to the China (Shanghai) region for geo-redundancy.'),
  policyName?: string(name='PolicyName', description='The name of the backup policy.', example='Daily Local Backup + Remote Backup'),
  policyType?: string(name='PolicyType', description='The policy type. Valid values:

*   **STANDARD**: the general backup policy. This type of policy applies to backups other than Elastic Compute Service (ECS) instance backup.
*   **UDM_ECS_ONLY**: This type of policy applies only to ECS instance backup.

If the policy type is not specified, Cloud Backup automatically sets the policy type based on whether the backup vault is specified in the rules of the policy:

*   If the backup vault is specified, Cloud Backup sets the policy type to **STANDARD**.
*   If the backup vault is not specified, Cloud Backup sets the policy type to **UDM_ECS_ONLY**.', example='STANDARD'),
  rulesShrink?: string(name='Rules', description='The rules in the backup policy.'),
}

model CreatePolicyV2ResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  policyId?: string(name='PolicyId', description='The ID of the backup policy.', example='po-000000zemnuyx2li3y9y'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EEC65C22-2152-5E31-8AD6-D6CBF1BFF49F'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
}

model CreatePolicyV2Response = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreatePolicyV2ResponseBody(name='body'),
}

/**
 * @summary Creates a backup policy.
 *
 * @description A backup policy records the information required for backup. After you execute a backup policy, a backup job is generated to record the backup progress and the backup result. If a backup job is completed, a backup snapshot is generated. You can use a backup snapshot to create a restore job.
 * *   A backup policy supports multiple data sources. The data sources can be only Elastic Compute Service (ECS) instances.
 * *   You can specify only one interval as a backup cycle in a backup policy.
 * *   Each backup policy allows you to back up data to only one backup vault.
 *
 * @param tmpReq CreatePolicyV2Request
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreatePolicyV2Response
 */
async function createPolicyV2WithOptions(tmpReq: CreatePolicyV2Request, runtime: Util.RuntimeOptions): CreatePolicyV2Response {
  Util.validateModel(tmpReq);
  var request = new CreatePolicyV2ShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.rules)) {
    request.rulesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.rules, 'Rules', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.policyDescription)) {
    body['PolicyDescription'] = request.policyDescription;
  }
  if (!Util.isUnset(request.policyName)) {
    body['PolicyName'] = request.policyName;
  }
  if (!Util.isUnset(request.policyType)) {
    body['PolicyType'] = request.policyType;
  }
  if (!Util.isUnset(request.rulesShrink)) {
    body['Rules'] = request.rulesShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreatePolicyV2',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a backup policy.
 *
 * @description A backup policy records the information required for backup. After you execute a backup policy, a backup job is generated to record the backup progress and the backup result. If a backup job is completed, a backup snapshot is generated. You can use a backup snapshot to create a restore job.
 * *   A backup policy supports multiple data sources. The data sources can be only Elastic Compute Service (ECS) instances.
 * *   You can specify only one interval as a backup cycle in a backup policy.
 * *   Each backup policy allows you to back up data to only one backup vault.
 *
 * @param request CreatePolicyV2Request
 * @return CreatePolicyV2Response
 */
async function createPolicyV2(request: CreatePolicyV2Request): CreatePolicyV2Response {
  var runtime = new Util.RuntimeOptions{};
  return createPolicyV2WithOptions(request, runtime);
}

model CreateReplicationVaultRequest {
  description?: string(name='Description', description='The description of the backup vault. The description must be 0 to 255 characters in length.', example='description'),
  encryptType?: string(name='EncryptType', description='The method that is used to encrypt the source data. This parameter is valid only if you set the VaultType parameter to STANDARD or OTS_BACKUP. Valid values:

*   **HBR_PRIVATE**: The source data is encrypted by using the built-in encryption method of Hybrid Backup Recovery (HBR).
*   **KMS**: The source data is encrypted by using Key Management Service (KMS).', example='HBR_PRIVATE'),
  kmsKeyId?: string(name='KmsKeyId', description='The customer master key (CMK) created in KMS or the alias of the key. This parameter is required only if you set the EncryptType parameter to KMS.', example='alias/test'),
  redundancyType?: string(name='RedundancyType', description='The data redundancy type of the backup vault. Valid values:

*   LRS: standard locally redundant storage (LRS). Cloud Backup stores the copies of each object on multiple devices of different facilities in the same zone. This way, Cloud Backup ensures data durability and availability even if hardware failures occur.
*   ZRS: standard zone-redundant storage (ZRS). Cloud Backup uses the multi-zone mechanism to distribute data across three zones within the same region. If a zone fails, the data that is stored in the other two zones is still accessible.', example='LRS'),
  replicationSourceRegionId?: string(name='ReplicationSourceRegionId', description='The ID of the region where the source vault resides.

This parameter is required.', example='cn-hangzhou'),
  replicationSourceVaultId?: string(name='ReplicationSourceVaultId', description='The ID of the source vault.

This parameter is required.', example='v-*********************'),
  vaultName?: string(name='VaultName', description='The name of the backup vault. The name must be 1 to 64 characters in length.

This parameter is required.', example='mirrorvaultname'),
  vaultRegionId?: string(name='VaultRegionId', description='The ID of the region where the backup vault resides.

This parameter is required.', example='cn-shanghai'),
  vaultStorageClass?: string(name='VaultStorageClass', description='The storage type of the backup vault. Valid value: **STANDARD**, which indicates standard storage.', example='STANDARD'),
}

model CreateReplicationVaultResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  taskId?: string(name='TaskId', description='The ID of the job that is used to initialize the backup vault. You can call the DescribeTask operation to query the job status.', example='t-*********************'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-*********************'),
}

model CreateReplicationVaultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateReplicationVaultResponseBody(name='body'),
}

/**
 * @summary Creates a mirror vault.
 *
 * @description After a backup vault is created, the backup vault is in the INITIALIZING state, and the system automatically runs an initialization task to initialize the backup vault. After the initialization task is completed, the backup vault is in the CREATED state.Call this operation in the region where the mirror vault resides, which is specified by the VaultRegionId parameter.
 *
 * @param request CreateReplicationVaultRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateReplicationVaultResponse
 */
async function createReplicationVaultWithOptions(request: CreateReplicationVaultRequest, runtime: Util.RuntimeOptions): CreateReplicationVaultResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.encryptType)) {
    query['EncryptType'] = request.encryptType;
  }
  if (!Util.isUnset(request.kmsKeyId)) {
    query['KmsKeyId'] = request.kmsKeyId;
  }
  if (!Util.isUnset(request.redundancyType)) {
    query['RedundancyType'] = request.redundancyType;
  }
  if (!Util.isUnset(request.replicationSourceRegionId)) {
    query['ReplicationSourceRegionId'] = request.replicationSourceRegionId;
  }
  if (!Util.isUnset(request.replicationSourceVaultId)) {
    query['ReplicationSourceVaultId'] = request.replicationSourceVaultId;
  }
  if (!Util.isUnset(request.vaultName)) {
    query['VaultName'] = request.vaultName;
  }
  if (!Util.isUnset(request.vaultRegionId)) {
    query['VaultRegionId'] = request.vaultRegionId;
  }
  if (!Util.isUnset(request.vaultStorageClass)) {
    query['VaultStorageClass'] = request.vaultStorageClass;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateReplicationVault',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a mirror vault.
 *
 * @description After a backup vault is created, the backup vault is in the INITIALIZING state, and the system automatically runs an initialization task to initialize the backup vault. After the initialization task is completed, the backup vault is in the CREATED state.Call this operation in the region where the mirror vault resides, which is specified by the VaultRegionId parameter.
 *
 * @param request CreateReplicationVaultRequest
 * @return CreateReplicationVaultResponse
 */
async function createReplicationVault(request: CreateReplicationVaultRequest): CreateReplicationVaultResponse {
  var runtime = new Util.RuntimeOptions{};
  return createReplicationVaultWithOptions(request, runtime);
}

model CreateRestoreJobRequest {
  crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the role created in the RAM of the original account for cross-account backup managed by the current account.', example='BackupRole'),
  crossAccountType?: string(name='CrossAccountType', description='Cross-account backup type. Supported values:
- SELF_ACCOUNT: Backup within the same account
- CROSS_ACCOUNT: Cross-account backup', example='SELF_ACCOUNT'),
  crossAccountUserId?: long(name='CrossAccountUserId', description='The original account ID managed by the current account for cross-account backup.', example='158975xxxxx4625'),
  exclude?: string(name='Exclude', description='The path not to be restored. All documents under this path will not be restored. Maximum length is 255 characters.', example='["/var", "/proc"]'),
  failbackDetail?: map[string]any(name='FailbackDetail', description='Details of restoring to the local environment.'),
  include?: string(name='Include', description='The path to be restored. All documents under this path will be restored. Maximum length is 255 characters.', example='["/home/alice/*.pdf", "/home/bob/*.txt"]'),
  initiatedByAck?: boolean(name='InitiatedByAck', description='Indicates whether it is called by the container service. Default is false.', example='false'),
  options?: string(name='Options', description='Parameters for the restore job.', example='{\\\\"includes\\\\":[],\\\\"excludes\\\\":[],\\\\"conflictPolicy\\\\":\\\\"OVERWRITE_EXISTING\\\\"}'),
  otsDetail?: OtsTableRestoreDetail(name='OtsDetail', description='Details of the Table Store instance.'),
  restoreType?: string(name='RestoreType', description='The type of the restore destination data source. Possible values:
  - **ECS_FILE**: Restore to ECS file.
  - **OSS**: Restore to Alibaba Cloud OSS.
  - **NAS**: Restore to Alibaba Cloud NAS.
  - **OTS_TABLE**: Restore to Alibaba Cloud OTS.
  - **UDM_ECS_ROLLBACK**: Restore to Alibaba Cloud ECS whole machine.

This parameter is required.', example='ECS_FILE'),
  snapshotHash?: string(name='SnapshotHash', description='The HASH value of the backup snapshot.', example='f2fe...'),
  snapshotId?: string(name='SnapshotId', description='The ID of the backup snapshot.', example='s-********************'),
  sourceType?: string(name='SourceType', description='The type of the data source. Possible values:
  - **ECS_FILE**: Restore ECS file.
  - **OSS**: Restore Alibaba Cloud OSS.
  - **NAS**: Restore Alibaba Cloud NAS.
  - **OTS_TABLE**: Restore to Alibaba Cloud OTS.
  - **UDM_ECS**: Restore to Alibaba Cloud ECS whole machine.

This parameter is required.', example='ECS_FILE'),
  targetBucket?: string(name='TargetBucket', description='Valid only when **RestoreType** is **OSS**. Indicates the name of the OSS bucket at the restore destination.', example='hbr-backup-oss'),
  targetContainer?: string(name='TargetContainer', description='Details of the target container.', example='{\\\\"host\\\\":\\\\"k8s-node1\\\\",\\\\"hostPrefix\\\\":\\\\"/var/lib/kubelet/pods/4acb31fe-8577-40ff-bc8c-eccabd835f73/volumes/kubernetes.io~csi/pvc-b050b00e-ef17-4792-aab1-1642355cf1f4/mount\\\\",\\\\"pvPath\\\\":\\\\"/\\\\"}'),
  targetContainerClusterId?: string(name='TargetContainerClusterId', description='The ID of the target container cluster.', example='cc-000amjsc7o1h9506oob7'),
  targetCreateTime?: long(name='TargetCreateTime', description='Valid only when **RestoreType** is **NAS**. Indicates the creation time of the file system at the restore destination.', example='1554347313'),
  targetFileSystemId?: string(name='TargetFileSystemId', description='Valid only when **RestoreType** is **NAS**. Indicates the ID of the file system at the restore destination.', example='005494'),
  targetInstanceId?: string(name='TargetInstanceId', description='Valid only when **RestoreType** is **ECS_FILE**. Indicates the ECS instance ID at the restore destination.', example='i-*********************'),
  targetInstanceName?: string(name='TargetInstanceName', description='The name of the target Table Store instance.', example='instancename'),
  targetPath?: string(name='TargetPath', description='Valid only when **RestoreType** is **ECS_FILE**. Indicates the file path at the restore destination.', example='C:\\\\'),
  targetPrefix?: string(name='TargetPrefix', description='Valid only when **RestoreType** is **OSS**. Indicates the object prefix at the restore destination.', example='hbr'),
  targetTableName?: string(name='TargetTableName', description='The name of the data table in the target Table Store.', example='tablename'),
  targetTime?: long(name='TargetTime', description='The time of the Table Store to be restored. UNIX timestamp, in seconds.', example='1642496881'),
  udmDetail?: map[string]any(name='UdmDetail', description='The parameter is valid only when the SourceType is set to UDM_ECS. It represents the details of the entire machine backup and is a JSON string. Depending on the value of RestoreType, different details must be passed as follows:
- **UDM_ECS_DISK**: ECS disk cloning.
  - **targetInstanceId**: string (required). Specifies the target ECS instance ID to which the cloned disk will be attached.
  - **diskCategory**: string (required). Specifies the type of the target disk.
  - **diskPerformanceLevel**: string. When diskCategory is "essd", this indicates the disk performance level, supporting PL0, PL1, PL2, and PL3, with PL1 as the default.
- **UDM_ECS_DISK_ROLLBACK**: ECS disk rollback.
  - **sourceInstanceId**: string (required). Specifies the source ECS instance ID.
  - **forceRestore**: bool (default: false). Indicates whether to force restore. NOTE: If forceRestore is set to true, the disk restoration will proceed even if the backup disk has been unmounted from the original ECS instance or mounted to another instance. Exercise caution when using this option.
  - **bootAfterRestore**: bool (default: false). Indicates whether to start the ECS instance after restoration.
- **UDM_ECS**: Full ECS cloning.
  - **bootAfterRestore**: bool (default: false). Indicates whether to start the ECS instance after restoration.
  - **diskCategory**: string (required). Specifies the type of the target disk.
  - **diskPerformanceLevel**: string. When diskCategory is "essd", this indicates the disk performance level (PL0/PL1/PL2/PL3), defaulting to PL1.
  - **instanceType**: string (required). Specifies the specification of the target ECS instance.
  - **restoredNetwork**: string (required). Specifies the vSwitch ID for the target ECS instance.
  - **securityGroup**: string (required). Specifies the security group ID for the target ECS instance.
  - **restoredName:** string (required). Specifies the instance name of the target ECS instance.
  - **restoredHostName**: string (required). Specifies the host name of the target ECS instance.
  - **allocatePublicIp**: bool (default: false). Indicates whether to assign a public IP to the target ECS instance.
  - **privateIpAddress**: string. Specifies the internal IP address of the target ECS instance. If not specified, an IP will be assigned via DHCP.
- **UDM_ECS_ROLLBACK**: Full ECS rollback.
  - **sourceInstanceId**: string (required). Specifies the source ECS instance ID.
  - **forceRestore**: bool (default: false). Indicates whether to force restore. NOTE: If forceRestore is set to true, the disk restoration will proceed even if the backup disk has been unmounted from the original ECS instance or mounted to another instance. Exercise caution when using this option.
  - **bootAfterRestore**: bool (default: false). Indicates whether to start the ECS instance after restoration.', example='{\\\\"sourceInstanceId\\\\":\\\\"i-uf62te6pm3iwsyxyz66q\\\\",\\\\"bootAfterRestore\\\\":false}'),
  udmRegionId?: string(name='UdmRegionId', description='Valid only when **SourceType** is **UDM_ECS**. Indicates the target region for the restore.', example='cn-shanghai'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault that the snapshot belongs to.', example='v-*********************'),
}

model CreateRestoreJobShrinkRequest {
  crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the role created in the RAM of the original account for cross-account backup managed by the current account.', example='BackupRole'),
  crossAccountType?: string(name='CrossAccountType', description='Cross-account backup type. Supported values:
- SELF_ACCOUNT: Backup within the same account
- CROSS_ACCOUNT: Cross-account backup', example='SELF_ACCOUNT'),
  crossAccountUserId?: long(name='CrossAccountUserId', description='The original account ID managed by the current account for cross-account backup.', example='158975xxxxx4625'),
  exclude?: string(name='Exclude', description='The path not to be restored. All documents under this path will not be restored. Maximum length is 255 characters.', example='["/var", "/proc"]'),
  failbackDetailShrink?: string(name='FailbackDetail', description='Details of restoring to the local environment.'),
  include?: string(name='Include', description='The path to be restored. All documents under this path will be restored. Maximum length is 255 characters.', example='["/home/alice/*.pdf", "/home/bob/*.txt"]'),
  initiatedByAck?: boolean(name='InitiatedByAck', description='Indicates whether it is called by the container service. Default is false.', example='false'),
  options?: string(name='Options', description='Parameters for the restore job.', example='{\\\\"includes\\\\":[],\\\\"excludes\\\\":[],\\\\"conflictPolicy\\\\":\\\\"OVERWRITE_EXISTING\\\\"}'),
  otsDetailShrink?: string(name='OtsDetail', description='Details of the Table Store instance.'),
  restoreType?: string(name='RestoreType', description='The type of the restore destination data source. Possible values:
  - **ECS_FILE**: Restore to ECS file.
  - **OSS**: Restore to Alibaba Cloud OSS.
  - **NAS**: Restore to Alibaba Cloud NAS.
  - **OTS_TABLE**: Restore to Alibaba Cloud OTS.
  - **UDM_ECS_ROLLBACK**: Restore to Alibaba Cloud ECS whole machine.

This parameter is required.', example='ECS_FILE'),
  snapshotHash?: string(name='SnapshotHash', description='The HASH value of the backup snapshot.', example='f2fe...'),
  snapshotId?: string(name='SnapshotId', description='The ID of the backup snapshot.', example='s-********************'),
  sourceType?: string(name='SourceType', description='The type of the data source. Possible values:
  - **ECS_FILE**: Restore ECS file.
  - **OSS**: Restore Alibaba Cloud OSS.
  - **NAS**: Restore Alibaba Cloud NAS.
  - **OTS_TABLE**: Restore to Alibaba Cloud OTS.
  - **UDM_ECS**: Restore to Alibaba Cloud ECS whole machine.

This parameter is required.', example='ECS_FILE'),
  targetBucket?: string(name='TargetBucket', description='Valid only when **RestoreType** is **OSS**. Indicates the name of the OSS bucket at the restore destination.', example='hbr-backup-oss'),
  targetContainer?: string(name='TargetContainer', description='Details of the target container.', example='{\\\\"host\\\\":\\\\"k8s-node1\\\\",\\\\"hostPrefix\\\\":\\\\"/var/lib/kubelet/pods/4acb31fe-8577-40ff-bc8c-eccabd835f73/volumes/kubernetes.io~csi/pvc-b050b00e-ef17-4792-aab1-1642355cf1f4/mount\\\\",\\\\"pvPath\\\\":\\\\"/\\\\"}'),
  targetContainerClusterId?: string(name='TargetContainerClusterId', description='The ID of the target container cluster.', example='cc-000amjsc7o1h9506oob7'),
  targetCreateTime?: long(name='TargetCreateTime', description='Valid only when **RestoreType** is **NAS**. Indicates the creation time of the file system at the restore destination.', example='1554347313'),
  targetFileSystemId?: string(name='TargetFileSystemId', description='Valid only when **RestoreType** is **NAS**. Indicates the ID of the file system at the restore destination.', example='005494'),
  targetInstanceId?: string(name='TargetInstanceId', description='Valid only when **RestoreType** is **ECS_FILE**. Indicates the ECS instance ID at the restore destination.', example='i-*********************'),
  targetInstanceName?: string(name='TargetInstanceName', description='The name of the target Table Store instance.', example='instancename'),
  targetPath?: string(name='TargetPath', description='Valid only when **RestoreType** is **ECS_FILE**. Indicates the file path at the restore destination.', example='C:\\\\'),
  targetPrefix?: string(name='TargetPrefix', description='Valid only when **RestoreType** is **OSS**. Indicates the object prefix at the restore destination.', example='hbr'),
  targetTableName?: string(name='TargetTableName', description='The name of the data table in the target Table Store.', example='tablename'),
  targetTime?: long(name='TargetTime', description='The time of the Table Store to be restored. UNIX timestamp, in seconds.', example='1642496881'),
  udmDetailShrink?: string(name='UdmDetail', description='The parameter is valid only when the SourceType is set to UDM_ECS. It represents the details of the entire machine backup and is a JSON string. Depending on the value of RestoreType, different details must be passed as follows:
- **UDM_ECS_DISK**: ECS disk cloning.
  - **targetInstanceId**: string (required). Specifies the target ECS instance ID to which the cloned disk will be attached.
  - **diskCategory**: string (required). Specifies the type of the target disk.
  - **diskPerformanceLevel**: string. When diskCategory is "essd", this indicates the disk performance level, supporting PL0, PL1, PL2, and PL3, with PL1 as the default.
- **UDM_ECS_DISK_ROLLBACK**: ECS disk rollback.
  - **sourceInstanceId**: string (required). Specifies the source ECS instance ID.
  - **forceRestore**: bool (default: false). Indicates whether to force restore. NOTE: If forceRestore is set to true, the disk restoration will proceed even if the backup disk has been unmounted from the original ECS instance or mounted to another instance. Exercise caution when using this option.
  - **bootAfterRestore**: bool (default: false). Indicates whether to start the ECS instance after restoration.
- **UDM_ECS**: Full ECS cloning.
  - **bootAfterRestore**: bool (default: false). Indicates whether to start the ECS instance after restoration.
  - **diskCategory**: string (required). Specifies the type of the target disk.
  - **diskPerformanceLevel**: string. When diskCategory is "essd", this indicates the disk performance level (PL0/PL1/PL2/PL3), defaulting to PL1.
  - **instanceType**: string (required). Specifies the specification of the target ECS instance.
  - **restoredNetwork**: string (required). Specifies the vSwitch ID for the target ECS instance.
  - **securityGroup**: string (required). Specifies the security group ID for the target ECS instance.
  - **restoredName:** string (required). Specifies the instance name of the target ECS instance.
  - **restoredHostName**: string (required). Specifies the host name of the target ECS instance.
  - **allocatePublicIp**: bool (default: false). Indicates whether to assign a public IP to the target ECS instance.
  - **privateIpAddress**: string. Specifies the internal IP address of the target ECS instance. If not specified, an IP will be assigned via DHCP.
- **UDM_ECS_ROLLBACK**: Full ECS rollback.
  - **sourceInstanceId**: string (required). Specifies the source ECS instance ID.
  - **forceRestore**: bool (default: false). Indicates whether to force restore. NOTE: If forceRestore is set to true, the disk restoration will proceed even if the backup disk has been unmounted from the original ECS instance or mounted to another instance. Exercise caution when using this option.
  - **bootAfterRestore**: bool (default: false). Indicates whether to start the ECS instance after restoration.', example='{\\\\"sourceInstanceId\\\\":\\\\"i-uf62te6pm3iwsyxyz66q\\\\",\\\\"bootAfterRestore\\\\":false}'),
  udmRegionId?: string(name='UdmRegionId', description='Valid only when **SourceType** is **UDM_ECS**. Indicates the target region for the restore.', example='cn-shanghai'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault that the snapshot belongs to.', example='v-*********************'),
}

model CreateRestoreJobResponseBody = {
  code?: string(name='Code', description='Return code, 200 indicates success.', example='200'),
  message?: string(name='Message', description='Description of the return message, usually \\\\"successful\\\\" when successful, and corresponding error messages when there is an error.', example='successful'),
  requestId?: string(name='RequestId', description='Request ID.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  restoreId?: string(name='RestoreId', description='Restore job ID.', example='r-*********************'),
  success?: boolean(name='Success', description='Whether the request was successful.
  - true: Success
  - false: Failure', example='true'),
}

model CreateRestoreJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateRestoreJobResponseBody(name='body'),
}

/**
 * @summary Create a restore job.
 *
 * @description - Create a restore job based on the selected snapshot and the restore destination.
 * - Currently, the data source type must match the restore destination data source type.
 *
 * @param tmpReq CreateRestoreJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateRestoreJobResponse
 */
async function createRestoreJobWithOptions(tmpReq: CreateRestoreJobRequest, runtime: Util.RuntimeOptions): CreateRestoreJobResponse {
  Util.validateModel(tmpReq);
  var request = new CreateRestoreJobShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.failbackDetail)) {
    request.failbackDetailShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.failbackDetail, 'FailbackDetail', 'json');
  }
  if (!Util.isUnset(tmpReq.otsDetail)) {
    request.otsDetailShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.otsDetail, 'OtsDetail', 'json');
  }
  if (!Util.isUnset(tmpReq.udmDetail)) {
    request.udmDetailShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.udmDetail, 'UdmDetail', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.crossAccountRoleName)) {
    query['CrossAccountRoleName'] = request.crossAccountRoleName;
  }
  if (!Util.isUnset(request.crossAccountType)) {
    query['CrossAccountType'] = request.crossAccountType;
  }
  if (!Util.isUnset(request.crossAccountUserId)) {
    query['CrossAccountUserId'] = request.crossAccountUserId;
  }
  if (!Util.isUnset(request.failbackDetailShrink)) {
    query['FailbackDetail'] = request.failbackDetailShrink;
  }
  if (!Util.isUnset(request.initiatedByAck)) {
    query['InitiatedByAck'] = request.initiatedByAck;
  }
  if (!Util.isUnset(request.options)) {
    query['Options'] = request.options;
  }
  if (!Util.isUnset(request.restoreType)) {
    query['RestoreType'] = request.restoreType;
  }
  if (!Util.isUnset(request.snapshotHash)) {
    query['SnapshotHash'] = request.snapshotHash;
  }
  if (!Util.isUnset(request.snapshotId)) {
    query['SnapshotId'] = request.snapshotId;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  if (!Util.isUnset(request.targetBucket)) {
    query['TargetBucket'] = request.targetBucket;
  }
  if (!Util.isUnset(request.targetContainer)) {
    query['TargetContainer'] = request.targetContainer;
  }
  if (!Util.isUnset(request.targetContainerClusterId)) {
    query['TargetContainerClusterId'] = request.targetContainerClusterId;
  }
  if (!Util.isUnset(request.targetCreateTime)) {
    query['TargetCreateTime'] = request.targetCreateTime;
  }
  if (!Util.isUnset(request.targetFileSystemId)) {
    query['TargetFileSystemId'] = request.targetFileSystemId;
  }
  if (!Util.isUnset(request.targetInstanceName)) {
    query['TargetInstanceName'] = request.targetInstanceName;
  }
  if (!Util.isUnset(request.targetPrefix)) {
    query['TargetPrefix'] = request.targetPrefix;
  }
  if (!Util.isUnset(request.targetTableName)) {
    query['TargetTableName'] = request.targetTableName;
  }
  if (!Util.isUnset(request.targetTime)) {
    query['TargetTime'] = request.targetTime;
  }
  if (!Util.isUnset(request.udmDetailShrink)) {
    query['UdmDetail'] = request.udmDetailShrink;
  }
  if (!Util.isUnset(request.udmRegionId)) {
    query['UdmRegionId'] = request.udmRegionId;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.exclude)) {
    body['Exclude'] = request.exclude;
  }
  if (!Util.isUnset(request.include)) {
    body['Include'] = request.include;
  }
  if (!Util.isUnset(request.otsDetailShrink)) {
    body['OtsDetail'] = request.otsDetailShrink;
  }
  if (!Util.isUnset(request.targetInstanceId)) {
    body['TargetInstanceId'] = request.targetInstanceId;
  }
  if (!Util.isUnset(request.targetPath)) {
    body['TargetPath'] = request.targetPath;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateRestoreJob',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Create a restore job.
 *
 * @description - Create a restore job based on the selected snapshot and the restore destination.
 * - Currently, the data source type must match the restore destination data source type.
 *
 * @param request CreateRestoreJobRequest
 * @return CreateRestoreJobResponse
 */
async function createRestoreJob(request: CreateRestoreJobRequest): CreateRestoreJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return createRestoreJobWithOptions(request, runtime);
}

model CreateTempFileUploadUrlRequest {
  fileName?: string(name='FileName', description='The name of the file to be uploaded.

This parameter is required.', example='file-list.txt'),
}

model CreateTempFileUploadUrlResponseBody = {
  bucketName?: string(name='BucketName', description='The name of the OSS bucket to which the file is uploaded.', example='hbr-temp-bucket'),
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  endpoint?: string(name='Endpoint', description='The endpoint that is used to upload the file to OSS.', example='oss-cn-shenzhen.aliyuncs.com'),
  expireTime?: long(name='ExpireTime', description='The expiration time of the signature that is used to upload the file to OSS. This value is a UNIX timestamp. Unit: seconds.', example='1654326678'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  ossAccessKeyId?: string(name='OssAccessKeyId', description='The AccessKey ID that is used to upload the file to OSS.', example='LTAI****Up'),
  policy?: string(name='Policy', description='The policy that is used to upload the file to OSS.', example='eyJleH****V19'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F4EEB401-DD21-588D-AE3B-1E835C7655E1'),
  signature?: string(name='Signature', description='The signature that is used to upload the file to OSS.', example='RmhI****0A='),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
  tempFileKey?: string(name='TempFileKey', description='The key that is used to upload the file to OSS.', example='temp/1440155109798732/upload/2022-07-29/49bed34c-b430-4e7e-89b1-4be2b734f95c/iaclone.diff'),
}

model CreateTempFileUploadUrlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTempFileUploadUrlResponseBody(name='body'),
}

/**
 * @summary Generates the parameters and signature required for a file upload URL.
 *
 * @description 1.  You can directly upload a file to Object Storage Service (OSS) by using a form based on the returned value of this operation.
 * 2.  For more information about how to upload a file to OSS by using a form, see OSS documentation.
 * 3.  The system periodically deletes files that are uploaded to OSS.
 *
 * @param request CreateTempFileUploadUrlRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateTempFileUploadUrlResponse
 */
async function createTempFileUploadUrlWithOptions(request: CreateTempFileUploadUrlRequest, runtime: Util.RuntimeOptions): CreateTempFileUploadUrlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateTempFileUploadUrl',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Generates the parameters and signature required for a file upload URL.
 *
 * @description 1.  You can directly upload a file to Object Storage Service (OSS) by using a form based on the returned value of this operation.
 * 2.  For more information about how to upload a file to OSS by using a form, see OSS documentation.
 * 3.  The system periodically deletes files that are uploaded to OSS.
 *
 * @param request CreateTempFileUploadUrlRequest
 * @return CreateTempFileUploadUrlResponse
 */
async function createTempFileUploadUrl(request: CreateTempFileUploadUrlRequest): CreateTempFileUploadUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return createTempFileUploadUrlWithOptions(request, runtime);
}

model CreateVaultRequest {
  description?: string(name='Description', description='The description of the backup vault. The description must be 0 to 255 characters in length.', example='description'),
  encryptType?: string(name='EncryptType', description='The method that is used to encrypt the source data. This parameter is valid only if you set the VaultType parameter to STANDARD or OTS_BACKUP. Valid values:

*   **HBR_PRIVATE**: The source data is encrypted by using the built-in encryption method of Hybrid Backup Recovery (HBR).
*   **KMS**: The source data is encrypted by using Key Management Service (KMS).', example='KMS'),
  kmsKeyId?: string(name='KmsKeyId', description='The customer master key (CMK) created in KMS or the alias of the key. This parameter is required only if you set the EncryptType parameter to KMS.', example='alias/yzs-hhht'),
  vaultName?: string(name='VaultName', description='The name of the backup vault. The name must be 1 to 64 characters in length.

This parameter is required.', example='backupvaultname'),
  vaultRegionId?: string(name='VaultRegionId', description='The ID of the region where the backup vault resides.

This parameter is required.', example='cn-shanghai'),
  vaultStorageClass?: string(name='VaultStorageClass', description='The storage type of the backup vault.

*   **STANDARD**: standard storage.
*   **ARCHIVE**: This parameter is deprecated.
*   **COLD_ARCHIVE**: This parameter is deprecated.
*   **IA**: This parameter is deprecated.', example='STANDARD'),
  vaultType?: string(name='VaultType', description='The type of the backup vault. Valid values:

*   **STANDARD**: standard backup vault
*   **OTS_BACKUP**: backup vault for Tablestore', example='STANDARD'),
  wormEnabled?: boolean(name='WormEnabled', description='Specifies whether to enable the immutable backup feature.', example='false'),
}

model CreateVaultResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
  taskId?: string(name='TaskId', description='The ID of the initialization task used to initialize the backup vault. You can call the DescribeTask operation to query the status of an initialization task.', example='t-*********************'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-*********************'),
}

model CreateVaultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateVaultResponseBody(name='body'),
}

/**
 * @summary Creates a backup vault.
 *
 * @description *   Each Alibaba Cloud account can create up to 100 backup vaults.
 * *   After a backup vault is created, the backup vault is in the INITIALIZING state, and the system automatically runs an initialization task to initialize the backup vault. After the initialization task is completed, the backup vault is in the CREATED state. A backup job can use a backup vault to store backup data only if the backup vault is in the CREATED state.
 *     **
 *     **Note** Before you call this operation, make sure that you fully understand the billing of Cloud Backup.
 *
 * @param request CreateVaultRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateVaultResponse
 */
async function createVaultWithOptions(request: CreateVaultRequest, runtime: Util.RuntimeOptions): CreateVaultResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.encryptType)) {
    query['EncryptType'] = request.encryptType;
  }
  if (!Util.isUnset(request.kmsKeyId)) {
    query['KmsKeyId'] = request.kmsKeyId;
  }
  if (!Util.isUnset(request.vaultName)) {
    query['VaultName'] = request.vaultName;
  }
  if (!Util.isUnset(request.vaultRegionId)) {
    query['VaultRegionId'] = request.vaultRegionId;
  }
  if (!Util.isUnset(request.vaultStorageClass)) {
    query['VaultStorageClass'] = request.vaultStorageClass;
  }
  if (!Util.isUnset(request.vaultType)) {
    query['VaultType'] = request.vaultType;
  }
  if (!Util.isUnset(request.wormEnabled)) {
    query['WormEnabled'] = request.wormEnabled;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateVault',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a backup vault.
 *
 * @description *   Each Alibaba Cloud account can create up to 100 backup vaults.
 * *   After a backup vault is created, the backup vault is in the INITIALIZING state, and the system automatically runs an initialization task to initialize the backup vault. After the initialization task is completed, the backup vault is in the CREATED state. A backup job can use a backup vault to store backup data only if the backup vault is in the CREATED state.
 *     **
 *     **Note** Before you call this operation, make sure that you fully understand the billing of Cloud Backup.
 *
 * @param request CreateVaultRequest
 * @return CreateVaultResponse
 */
async function createVault(request: CreateVaultRequest): CreateVaultResponse {
  var runtime = new Util.RuntimeOptions{};
  return createVaultWithOptions(request, runtime);
}

model DeleteAirEcsInstanceRequest {
  ecsInstanceId?: string(name='EcsInstanceId', description='The ID of the Elastic Compute Service (ECS) instance.', example='i-uf6ir9y******hvisj'),
  uninstallClientSourceTypes?: [ string ](name='UninstallClientSourceTypes', description='The data sources for which the client needs to be uninstalled.'),
}

model DeleteAirEcsInstanceShrinkRequest {
  ecsInstanceId?: string(name='EcsInstanceId', description='The ID of the Elastic Compute Service (ECS) instance.', example='i-uf6ir9y******hvisj'),
  uninstallClientSourceTypesShrink?: string(name='UninstallClientSourceTypes', description='The data sources for which the client needs to be uninstalled.'),
}

model DeleteAirEcsInstanceResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='Id of the request', example='33AA3AAE-89E1-5D3A-A51D-0C0A80850F68'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  taskId?: string(name='TaskId', description='The ID of the asynchronous job. You can call the DescribeTask operation to query the execution result of an asynchronous job.', example='t-*********************'),
}

model DeleteAirEcsInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAirEcsInstanceResponseBody(name='body'),
}

/**
 * @summary Removes the Elastic Compute Service (ECS) instance that is used for restoration only in ECS Backup Essential Edition.
 *
 * @param tmpReq DeleteAirEcsInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAirEcsInstanceResponse
 */
async function deleteAirEcsInstanceWithOptions(tmpReq: DeleteAirEcsInstanceRequest, runtime: Util.RuntimeOptions): DeleteAirEcsInstanceResponse {
  Util.validateModel(tmpReq);
  var request = new DeleteAirEcsInstanceShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.uninstallClientSourceTypes)) {
    request.uninstallClientSourceTypesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.uninstallClientSourceTypes, 'UninstallClientSourceTypes', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.ecsInstanceId)) {
    query['EcsInstanceId'] = request.ecsInstanceId;
  }
  if (!Util.isUnset(request.uninstallClientSourceTypesShrink)) {
    query['UninstallClientSourceTypes'] = request.uninstallClientSourceTypesShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAirEcsInstance',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Removes the Elastic Compute Service (ECS) instance that is used for restoration only in ECS Backup Essential Edition.
 *
 * @param request DeleteAirEcsInstanceRequest
 * @return DeleteAirEcsInstanceResponse
 */
async function deleteAirEcsInstance(request: DeleteAirEcsInstanceRequest): DeleteAirEcsInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAirEcsInstanceWithOptions(request, runtime);
}

model DeleteBackupClientRequest {
  clientId?: string(name='ClientId', description='The ID of the Cloud Backup client.

This parameter is required.', example='c-*********************'),
}

model DeleteBackupClientResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DeleteBackupClientResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteBackupClientResponseBody(name='body'),
}

/**
 * @summary Deletes a Cloud Backup client.
 *
 * @description *   You cannot delete the active Cloud Backup clients that receive heartbeat packets within 1 hour. You can call the UninstallBackupClients operation to uninstall a Cloud Backup client. Then, the client becomes inactive.
 * *   When you perform this operation, resources that are associated with the client are also deleted, including:
 *     *   Backup plans
 *     *   Backup jobs
 *     *   Snapshots
 *
 * @param request DeleteBackupClientRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteBackupClientResponse
 */
async function deleteBackupClientWithOptions(request: DeleteBackupClientRequest, runtime: Util.RuntimeOptions): DeleteBackupClientResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientId)) {
    query['ClientId'] = request.clientId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteBackupClient',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a Cloud Backup client.
 *
 * @description *   You cannot delete the active Cloud Backup clients that receive heartbeat packets within 1 hour. You can call the UninstallBackupClients operation to uninstall a Cloud Backup client. Then, the client becomes inactive.
 * *   When you perform this operation, resources that are associated with the client are also deleted, including:
 *     *   Backup plans
 *     *   Backup jobs
 *     *   Snapshots
 *
 * @param request DeleteBackupClientRequest
 * @return DeleteBackupClientResponse
 */
async function deleteBackupClient(request: DeleteBackupClientRequest): DeleteBackupClientResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteBackupClientWithOptions(request, runtime);
}

model DeleteBackupClientResourceRequest {
  clientIds?: map[string]any(name='ClientIds', description='The IDs of HBR clients. The value can be a JSON array that consists of up to 100 client IDs. Separate the IDs with commas (,).

This parameter is required.', example='["c-0007kyu045r0********", "c-000b6818umvo********"]'),
}

model DeleteBackupClientResourceShrinkRequest {
  clientIdsShrink?: string(name='ClientIds', description='The IDs of HBR clients. The value can be a JSON array that consists of up to 100 client IDs. Separate the IDs with commas (,).

This parameter is required.', example='["c-0007kyu045r0********", "c-000b6818umvo********"]'),
}

model DeleteBackupClientResourceResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
}

model DeleteBackupClientResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteBackupClientResourceResponseBody(name='body'),
}

/**
 * @summary Deletes the resources that are related to one or more HBR clients.
 *
 * @description This operation deletes only the resources that are related to HBR clients. The resources include backup plans, backup jobs, and backup snapshots. The operation does not delete HBR clients.
 *
 * @param tmpReq DeleteBackupClientResourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteBackupClientResourceResponse
 */
async function deleteBackupClientResourceWithOptions(tmpReq: DeleteBackupClientResourceRequest, runtime: Util.RuntimeOptions): DeleteBackupClientResourceResponse {
  Util.validateModel(tmpReq);
  var request = new DeleteBackupClientResourceShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.clientIds)) {
    request.clientIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.clientIds, 'ClientIds', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.clientIdsShrink)) {
    query['ClientIds'] = request.clientIdsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteBackupClientResource',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes the resources that are related to one or more HBR clients.
 *
 * @description This operation deletes only the resources that are related to HBR clients. The resources include backup plans, backup jobs, and backup snapshots. The operation does not delete HBR clients.
 *
 * @param request DeleteBackupClientResourceRequest
 * @return DeleteBackupClientResourceResponse
 */
async function deleteBackupClientResource(request: DeleteBackupClientResourceRequest): DeleteBackupClientResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteBackupClientResourceWithOptions(request, runtime);
}

model DeleteBackupPlanRequest {
  planId?: string(name='PlanId', description='The ID of the backup plan.

This parameter is required.', example='plan-*********************'),
  requireNoRunningJobs?: boolean(name='RequireNoRunningJobs', description='Specifies whether no running jobs are required.', example='false'),
  sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **ECS_FILE**: Elastic Compute Service (ECS) files
*   **OSS**: Object Storage Service (OSS) buckets
*   **NAS**: Apsara File Storage NAS file systems
*   **UDM_ECS**: ECS instances
*   **OTS**: Tablestore instances', example='ECS_FILE'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault. This parameter is required if the SourceType parameter is not set to UDM_ECS.', example='v-*********************'),
}

model DeleteBackupPlanResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
}

model DeleteBackupPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteBackupPlanResponseBody(name='body'),
}

/**
 * @summary Deletes a backup plan.
 *
 * @description *   If you delete a backup plan, the backup jobs are also deleted.
 * *   If you delete a backup plan, the created snapshot files are not deleted.
 *
 * @param request DeleteBackupPlanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteBackupPlanResponse
 */
async function deleteBackupPlanWithOptions(request: DeleteBackupPlanRequest, runtime: Util.RuntimeOptions): DeleteBackupPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  if (!Util.isUnset(request.requireNoRunningJobs)) {
    query['RequireNoRunningJobs'] = request.requireNoRunningJobs;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteBackupPlan',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a backup plan.
 *
 * @description *   If you delete a backup plan, the backup jobs are also deleted.
 * *   If you delete a backup plan, the created snapshot files are not deleted.
 *
 * @param request DeleteBackupPlanRequest
 * @return DeleteBackupPlanResponse
 */
async function deleteBackupPlan(request: DeleteBackupPlanRequest): DeleteBackupPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteBackupPlanWithOptions(request, runtime);
}

model DeleteClientRequest {
  clientId?: string(name='ClientId', description='The ID of the client.', example='c-000************f3h'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acf************kwy'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-000************gs3'),
}

model DeleteClientResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='C51A9094-64B7-5DC0-B9FE-5FC1AC7E081D'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
}

model DeleteClientResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteClientResponseBody(name='body'),
}

/**
 * @param request DeleteClientRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteClientResponse
 */
async function deleteClientWithOptions(request: DeleteClientRequest, runtime: Util.RuntimeOptions): DeleteClientResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientId)) {
    query['ClientId'] = request.clientId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteClient',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteClientRequest
 * @return DeleteClientResponse
 */
async function deleteClient(request: DeleteClientRequest): DeleteClientResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteClientWithOptions(request, runtime);
}

model DeleteHanaBackupPlanRequest {
  clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance.

This parameter is required.', example='cl-000br3******0ooy2'),
  planId?: string(name='PlanId', description='The ID of the backup plan.

This parameter is required.', example='pl-00035lc8pwp1azdf3qku'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfm4ebtpkzx7zy'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.

This parameter is required.', example='v-0007o******1ssno'),
}

model DeleteHanaBackupPlanResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='071E4789-6256-526B-B22E-2A9CDDB9EB21'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DeleteHanaBackupPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteHanaBackupPlanResponseBody(name='body'),
}

/**
 * @summary Deletes an SAP HANA backup plan.
 *
 * @param request DeleteHanaBackupPlanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteHanaBackupPlanResponse
 */
async function deleteHanaBackupPlanWithOptions(request: DeleteHanaBackupPlanRequest, runtime: Util.RuntimeOptions): DeleteHanaBackupPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteHanaBackupPlan',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes an SAP HANA backup plan.
 *
 * @param request DeleteHanaBackupPlanRequest
 * @return DeleteHanaBackupPlanResponse
 */
async function deleteHanaBackupPlan(request: DeleteHanaBackupPlanRequest): DeleteHanaBackupPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteHanaBackupPlanWithOptions(request, runtime);
}

model DeleteHanaInstanceRequest {
  clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance.

This parameter is required.', example='cl-000g4z09******9cfc'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmwutpyat2kwy'),
  sid?: string(name='Sid', description='The security identifier (SID) of the SAP HANA database. You must specify a valid SID. The SID must be three characters in length and start with a letter. For more information, see [How to find sid user and instance number of HANA db?](https://answers.sap.com/questions/555192/how-to-find-sid-user-and-instance-number-of-hana-d.html?)

This parameter is required.', example='HXE'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.

This parameter is required.', example='v-0008n2******ax3'),
}

model DeleteHanaInstanceResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='28EAF89A-E0D8-5C04-9A1D-B373B29BCFB9'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DeleteHanaInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteHanaInstanceResponseBody(name='body'),
}

/**
 * @summary Deletes an SAP HANA instance.
 *
 * @description If you delete an SAP HANA instance, the existing backup data is also deleted and the running backup and restore jobs fail to be completed. Before you delete the SAP HANA instance, make sure that you no longer need the backup data of the instance and no backup or restore jobs are running for the instance. To delete an SAP HANA instance, you must specify the security identifier (SID) of the instance. The SID is three characters in length and starts with a letter. For more information, see [How to find sid user and instance number of HANA db?](https://answers.sap.com/questions/555192/how-to-find-sid-user-and-instance-number-of-hana-d.html?)
 *
 * @param request DeleteHanaInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteHanaInstanceResponse
 */
async function deleteHanaInstanceWithOptions(request: DeleteHanaInstanceRequest, runtime: Util.RuntimeOptions): DeleteHanaInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sid)) {
    query['Sid'] = request.sid;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteHanaInstance',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes an SAP HANA instance.
 *
 * @description If you delete an SAP HANA instance, the existing backup data is also deleted and the running backup and restore jobs fail to be completed. Before you delete the SAP HANA instance, make sure that you no longer need the backup data of the instance and no backup or restore jobs are running for the instance. To delete an SAP HANA instance, you must specify the security identifier (SID) of the instance. The SID is three characters in length and starts with a letter. For more information, see [How to find sid user and instance number of HANA db?](https://answers.sap.com/questions/555192/how-to-find-sid-user-and-instance-number-of-hana-d.html?)
 *
 * @param request DeleteHanaInstanceRequest
 * @return DeleteHanaInstanceResponse
 */
async function deleteHanaInstance(request: DeleteHanaInstanceRequest): DeleteHanaInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteHanaInstanceWithOptions(request, runtime);
}

model DeletePolicyBindingRequest {
  dataSourceIds?: [ string ](name='DataSourceIds', description='The IDs of the data sources that you want to disassociate from the backup policy.'),
  policyId?: string(name='PolicyId', description='The ID of the backup policy.

This parameter is required.', example='po-000************hgp'),
  sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **UDM_ECS**: ECS instance backup', example='UDM_ECS'),
}

model DeletePolicyBindingShrinkRequest {
  dataSourceIdsShrink?: string(name='DataSourceIds', description='The IDs of the data sources that you want to disassociate from the backup policy.'),
  policyId?: string(name='PolicyId', description='The ID of the backup policy.

This parameter is required.', example='po-000************hgp'),
  sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **UDM_ECS**: ECS instance backup', example='UDM_ECS'),
}

model DeletePolicyBindingResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='3E961A5E-C5C6-566D-BFC3-0362A6A52EBA'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
}

model DeletePolicyBindingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeletePolicyBindingResponseBody(name='body'),
}

/**
 * @summary Disassociates one or more data sources from a backup policy. After you disassociate the data sources from the backup policy, the backup policy no longer protects the data sources. Proceed with caution.
 *
 * @param tmpReq DeletePolicyBindingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeletePolicyBindingResponse
 */
async function deletePolicyBindingWithOptions(tmpReq: DeletePolicyBindingRequest, runtime: Util.RuntimeOptions): DeletePolicyBindingResponse {
  Util.validateModel(tmpReq);
  var request = new DeletePolicyBindingShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.dataSourceIds)) {
    request.dataSourceIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.dataSourceIds, 'DataSourceIds', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.dataSourceIdsShrink)) {
    body['DataSourceIds'] = request.dataSourceIdsShrink;
  }
  if (!Util.isUnset(request.policyId)) {
    body['PolicyId'] = request.policyId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeletePolicyBinding',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Disassociates one or more data sources from a backup policy. After you disassociate the data sources from the backup policy, the backup policy no longer protects the data sources. Proceed with caution.
 *
 * @param request DeletePolicyBindingRequest
 * @return DeletePolicyBindingResponse
 */
async function deletePolicyBinding(request: DeletePolicyBindingRequest): DeletePolicyBindingResponse {
  var runtime = new Util.RuntimeOptions{};
  return deletePolicyBindingWithOptions(request, runtime);
}

model DeletePolicyV2Request {
  policyId?: string(name='PolicyId', description='The ID of the backup policy.', example='po-000************2l6'),
}

model DeletePolicyV2ResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='33AA3AAE-89E1-5D3A-A51D-0C0A80850F68'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
}

model DeletePolicyV2Response = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeletePolicyV2ResponseBody(name='body'),
}

/**
 * @summary Deletes a backup policy.
 *
 * @description If you delete a backup policy, the backup policy is disassociated with all data sources. Proceed with caution.
 *
 * @param request DeletePolicyV2Request
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeletePolicyV2Response
 */
async function deletePolicyV2WithOptions(request: DeletePolicyV2Request, runtime: Util.RuntimeOptions): DeletePolicyV2Response {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.policyId)) {
    body['PolicyId'] = request.policyId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeletePolicyV2',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a backup policy.
 *
 * @description If you delete a backup policy, the backup policy is disassociated with all data sources. Proceed with caution.
 *
 * @param request DeletePolicyV2Request
 * @return DeletePolicyV2Response
 */
async function deletePolicyV2(request: DeletePolicyV2Request): DeletePolicyV2Response {
  var runtime = new Util.RuntimeOptions{};
  return deletePolicyV2WithOptions(request, runtime);
}

model DeleteSnapshotRequest {
  clientId?: string(name='ClientId', description='The ID of the Cloud Backup client. If you delete a backup snapshot for Elastic Compute Service (ECS) instances, you must specify one of the ClientId and **InstanceId** parameters.', example='c-*********************'),
  force?: boolean(name='Force', description='This parameter is deprecated.', example='Deprected.', deprecated=true),
  instanceId?: string(name='InstanceId', description='The ID of the ECS instance. If you delete a backup snapshot for ECS instances, you must specify one of the InstanceId and **ClientId** parameters.', example='i-*********************'),
  snapshotId?: string(name='SnapshotId', description='The ID of the backup snapshot.

This parameter is required.', example='s-*********************'),
  sourceType?: string(name='SourceType', description='The type of the backup source. Valid values:

*   **ECS_FILE**: backup snapshots for ECS files
*   **OSS**: backup snapshots for Object Storage Service (OSS) buckets
*   **NAS**: backup snapshots for Apsara File Storage NAS (NAS) file systems', example='ECS_FILE'),
  token?: string(name='Token', description='The token that you want to delete.', example='02WJDOE7'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-*********************'),
}

model DeleteSnapshotResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DeleteSnapshotResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSnapshotResponseBody(name='body'),
}

/**
 * @summary Deletes a backup snapshot.
 *
 * @param request DeleteSnapshotRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSnapshotResponse
 */
async function deleteSnapshotWithOptions(request: DeleteSnapshotRequest, runtime: Util.RuntimeOptions): DeleteSnapshotResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientId)) {
    query['ClientId'] = request.clientId;
  }
  if (!Util.isUnset(request.force)) {
    query['Force'] = request.force;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.snapshotId)) {
    query['SnapshotId'] = request.snapshotId;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  if (!Util.isUnset(request.token)) {
    query['Token'] = request.token;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSnapshot',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a backup snapshot.
 *
 * @param request DeleteSnapshotRequest
 * @return DeleteSnapshotResponse
 */
async function deleteSnapshot(request: DeleteSnapshotRequest): DeleteSnapshotResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSnapshotWithOptions(request, runtime);
}

model DeleteUdmDiskRequest {
  diskId?: string(name='DiskId', description='The disk ID.', example='d-bp15************xy70'),
}

model DeleteUdmDiskResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='Id of the request', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.

*   true
*   false', example='true'),
}

model DeleteUdmDiskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteUdmDiskResponseBody(name='body'),
}

/**
 * @summary Cancels a protected disk.
 *
 * @param request DeleteUdmDiskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteUdmDiskResponse
 */
async function deleteUdmDiskWithOptions(request: DeleteUdmDiskRequest, runtime: Util.RuntimeOptions): DeleteUdmDiskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.diskId)) {
    query['DiskId'] = request.diskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteUdmDisk',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Cancels a protected disk.
 *
 * @param request DeleteUdmDiskRequest
 * @return DeleteUdmDiskResponse
 */
async function deleteUdmDisk(request: DeleteUdmDiskRequest): DeleteUdmDiskResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteUdmDiskWithOptions(request, runtime);
}

model DeleteUdmEcsInstanceRequest {
  instanceId?: string(name='InstanceId', description='The ID of the ECS instance.

This parameter is required.', example='i-2zed************tlrm'),
}

model DeleteUdmEcsInstanceResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='0497C0D3-82B5-56B2-8D64-D62E61B90E95'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DeleteUdmEcsInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteUdmEcsInstanceResponseBody(name='body'),
}

/**
 * @summary Stops protection for Elastic Compute Service (ECS) instance backup.
 *
 * @param request DeleteUdmEcsInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteUdmEcsInstanceResponse
 */
async function deleteUdmEcsInstanceWithOptions(request: DeleteUdmEcsInstanceRequest, runtime: Util.RuntimeOptions): DeleteUdmEcsInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteUdmEcsInstance',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Stops protection for Elastic Compute Service (ECS) instance backup.
 *
 * @param request DeleteUdmEcsInstanceRequest
 * @return DeleteUdmEcsInstanceResponse
 */
async function deleteUdmEcsInstance(request: DeleteUdmEcsInstanceRequest): DeleteUdmEcsInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteUdmEcsInstanceWithOptions(request, runtime);
}

model DeleteVaultRequest {
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmoiyerpacj4q'),
  token?: string(name='Token', description='The token.', example='caeba0bbb2be03f84eb48b699f0a*'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-*********************'),
}

model DeleteVaultResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DeleteVaultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteVaultResponseBody(name='body'),
}

/**
 * @summary Deletes a backup vault.
 *
 * @description *   You cannot delete a backup vault within 2 hours after the backup vault is created or a backup vault that is in the INITIALIZING state.
 * *   After you delete a backup vault, all resources that are associated with the backup vault are deleted. The resources include the Cloud Backup client of the old version, backup plans, backup jobs, snapshots, and restore jobs.
 *
 * @param request DeleteVaultRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteVaultResponse
 */
async function deleteVaultWithOptions(request: DeleteVaultRequest, runtime: Util.RuntimeOptions): DeleteVaultResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.token)) {
    query['Token'] = request.token;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteVault',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a backup vault.
 *
 * @description *   You cannot delete a backup vault within 2 hours after the backup vault is created or a backup vault that is in the INITIALIZING state.
 * *   After you delete a backup vault, all resources that are associated with the backup vault are deleted. The resources include the Cloud Backup client of the old version, backup plans, backup jobs, snapshots, and restore jobs.
 *
 * @param request DeleteVaultRequest
 * @return DeleteVaultResponse
 */
async function deleteVault(request: DeleteVaultRequest): DeleteVaultResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteVaultWithOptions(request, runtime);
}

model DescribeBackupClientsRequest {
  clientIds?: [ string ](name='ClientIds', description='The IDs of HBR clients.', example='["c-*********************"]'),
  clientType?: string(name='ClientType', description='The type of the HBR client. Valid values:

*   **ECS_CLIENT**: HBR client for Elastic Compute Service (ECS) file backup
*   **CONTAINER_CLIENT**: HBR client for container backup

This parameter is required.', example='ECS_CLIENT'),
  clusterId?: string(name='ClusterId', description='The ID of the cluster for the backup.', example='cl-000ge4wa61b4d337xblq'),
  crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the RAM role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='hbrcrossrole'),
  crossAccountType?: string(name='CrossAccountType', description='Specifies whether data is backed up within the same Alibaba Cloud account or across Alibaba Cloud accounts. Valid values:

*   SELF_ACCOUNT: Data is backed up within the same Alibaba Cloud account.
*   CROSS_ACCOUNT: Data is backed up across Alibaba Cloud accounts.', example='CROSS_ACCOUNT'),
  crossAccountUserId?: long(name='CrossAccountUserId', description='The ID of the source Alibaba Cloud account that authorizes the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='129374672382xxxx'),
  filters?: [ 
    {
      key?: string(name='Key'),
      values?: [ string ](name='Values'),
    }
  ](name='Filters'),
  instanceIds?: [ string ](name='InstanceIds', description='The IDs of ECS instances.', example='["i-*********************"]'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 99. Default value: 10.', example='10'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key of the backup vault. Valid values of N: 1 to 20.

*   The tag key cannot start with `aliyun` or `acs:`.
*   The tag key cannot contain `http://` or `https://`.
*   The tag key cannot be an empty string.', example='TestKey'),
      value?: string(name='Value', description='The tag value of the backup vault. Valid values of N: 1 to 20.

*   The tag value cannot start with `aliyun` or `acs:`.
*   The tag value cannot contain `http://` or `https://`.
*   The tag value cannot be an empty string.', example='TestValue'),
    }
  ](name='Tag', description='The tags.', example='33738719#'),
}

model DescribeBackupClientsShrinkRequest {
  clientIdsShrink?: string(name='ClientIds', description='The IDs of HBR clients.', example='["c-*********************"]'),
  clientType?: string(name='ClientType', description='The type of the HBR client. Valid values:

*   **ECS_CLIENT**: HBR client for Elastic Compute Service (ECS) file backup
*   **CONTAINER_CLIENT**: HBR client for container backup

This parameter is required.', example='ECS_CLIENT'),
  clusterId?: string(name='ClusterId', description='The ID of the cluster for the backup.', example='cl-000ge4wa61b4d337xblq'),
  crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the RAM role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='hbrcrossrole'),
  crossAccountType?: string(name='CrossAccountType', description='Specifies whether data is backed up within the same Alibaba Cloud account or across Alibaba Cloud accounts. Valid values:

*   SELF_ACCOUNT: Data is backed up within the same Alibaba Cloud account.
*   CROSS_ACCOUNT: Data is backed up across Alibaba Cloud accounts.', example='CROSS_ACCOUNT'),
  crossAccountUserId?: long(name='CrossAccountUserId', description='The ID of the source Alibaba Cloud account that authorizes the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='129374672382xxxx'),
  filters?: [ 
    {
      key?: string(name='Key'),
      values?: [ string ](name='Values'),
    }
  ](name='Filters'),
  instanceIdsShrink?: string(name='InstanceIds', description='The IDs of ECS instances.', example='["i-*********************"]'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 99. Default value: 10.', example='10'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key of the backup vault. Valid values of N: 1 to 20.

*   The tag key cannot start with `aliyun` or `acs:`.
*   The tag key cannot contain `http://` or `https://`.
*   The tag key cannot be an empty string.', example='TestKey'),
      value?: string(name='Value', description='The tag value of the backup vault. Valid values of N: 1 to 20.

*   The tag value cannot start with `aliyun` or `acs:`.
*   The tag value cannot contain `http://` or `https://`.
*   The tag value cannot be an empty string.', example='TestValue'),
    }
  ](name='Tag', description='The tags.', example='33738719#'),
}

model DescribeBackupClientsResponseBody = {
  clients?: [ 
    {
      appliance?: boolean(name='Appliance', description='Indicates whether the client is installed on an all-in-one PC that integrates hardware and monitoring program. Valid values:

*   true: The client is installed on an all-in-one PC that integrates hardware and monitoring program.
*   false: The client is not installed on an all-in-one PC that integrates hardware and monitoring program.', example='false'),
      archType?: string(name='ArchType', description='This parameter is valid only if the **ClientType** parameter is set to **ECS_CLIENT**. This parameter indicates the system architecture where the backup client resides. Valid values:

*   **amd64**
*   **386**', example='amd64'),
      backupStatus?: string(name='BackupStatus', description='The protection status of the backup client. Valid values:

*   **UNPROTECTED**: The backup client is not protected.
*   **PROTECTED**: The backup client is protected.', example='PROTECTED'),
      clientId?: string(name='ClientId', description='The ID of the backup client.', example='c-*********************'),
      clientType?: string(name='ClientType', description='The type of the backup client. Valid value: **ECS_CLIENT**, which indicates a client for ECS file backup.', example='ECS_CLIENT'),
      clientVersion?: string(name='ClientVersion', description='The version number of the backup client.', example='2.4.5'),
      createdTime?: long(name='CreatedTime', description='The time when the backup client was created. The value is a UNIX timestamp. Unit: seconds.', example='1554347313'),
      hostname?: string(name='Hostname', description='The hostname of the backup client.', example='hostname'),
      instanceId?: string(name='InstanceId', description='The instance ID.

*   If the client is used to back up ECS files, this parameter indicates the ID of an ECS instance.
*   If the client is used to back up on-premises files, this parameter indicates the hardware fingerprint that is generated based on the system information.', example='i-*********************'),
      instanceName?: string(name='InstanceName', description='This parameter is valid only if the **ClientType** parameter is set to **ECS_CLIENT**. This parameter indicates the name of the ECS instance.', example='instancename'),
      lastHeartBeatTime?: long(name='LastHeartBeatTime', description='The last heartbeat time of the backup client. The value is a UNIX timestamp. Unit: seconds.', example='1554347313'),
      maxClientVersion?: string(name='MaxClientVersion', description='The latest version number of the backup client.', example='2.4.5'),
      osType?: string(name='OsType', description='This parameter is valid only if the **ClientType** parameter is set to **ECS_CLIENT**. This parameter indicates the operating system type of the backup client. Valid values:

*   **windows**
*   **linux**', example='linux'),
      privateIpV4?: string(name='PrivateIpV4', description='This parameter is valid only if the **ClientType** parameter is set to **ECS_CLIENT**. This parameter indicates the internal IP address of the ECS instance.', example='192.168.1.1'),
      settings?: {
        alertOnPartialComplete?: boolean(name='AlertOnPartialComplete', description='Indicates whether alerts are generated for partially completed jobs. This parameter is valid only for on-premises file backup and ECS file backup.', example='false'),
        dataNetworkType?: string(name='DataNetworkType', description='The type of the endpoint on the data plane. Valid values:

*   **PUBLIC**: Internet
*   **VPC**: virtual private cloud (VPC)
*   **CLASSIC**: classic network', example='VPC'),
        dataProxySetting?: string(name='DataProxySetting', description='The proxy configuration on the data plane. Valid values:

*   **DISABLE**: The proxy is not used.
*   **USE_CONTROL_PROXY** (default): The configuration is the same as that on the control plane.
*   **CUSTOM**: The configuration is customized (HTTP).', example='USE_CONTROL_PROXY'),
        maxCpuCore?: string(name='MaxCpuCore', description='The number of CPU cores used by a single backup job. The value 0 indicates that the number is unlimited.', example='1'),
        maxMemory?: long(name='MaxMemory', description='The maximum memory that can be used by the client. Unit: bytes. Only V2.13.0 and later are supported.', example='0'),
        maxWorker?: string(name='MaxWorker', description='The number of concurrent backup jobs. The value 0 indicates that the number is unlimited.', example='1'),
        proxyHost?: string(name='ProxyHost', description='The custom host IP address of the proxy server on the data plane.', example='192.168.11.100'),
        proxyPassword?: string(name='ProxyPassword', description='The custom password of the proxy server on the data plane.', example='******'),
        proxyPort?: int32(name='ProxyPort', description='The custom host port of the proxy server on the data plane.', example='3128'),
        proxyUser?: string(name='ProxyUser', description='The custom username of the proxy server on the data plane.', example='user'),
        useHttps?: string(name='UseHttps', description='Indicates whether data on the data plane is transmitted over HTTPS. Valid values:

*   true: Data is transmitted over HTTPS.
*   false: Data is transmitted over HTTP.', example='false'),
      }(name='Settings', description='The configuration information of the backup client.'),
      status?: string(name='Status', description='The status of the backup client. Valid values:

*   **REGISTERED**: The backup client is registered.
*   **ACTIVATED**: The backup client is activated.
*   **DEACTIVATED**: The backup client fails to be activated.
*   **INSTALLING**: The backup client is being installed.
*   **INSTALL_FAILED**: The backup client fails to be installed.
*   **NOT_INSTALLED**: The backup client is not installed.
*   **UPGRADING**: The backup client is being upgraded.
*   **UPGRADE_FAILED**: The backup client fails to be upgraded.
*   **UNINSTALLING**: The backup client is being uninstalled.
*   **UNINSTALL_FAILED**: The backup client fails to be uninstalled.
*   **STOPPED**: The backup client is out of service.
*   **UNKNOWN**: The backup client is disconnected.', example='ACTIVATED'),
      tags?: [ 
        {
          key?: string(name='Key', description='The tag key of the backup vault. Valid values of N: 1 to 20

*   The tag key cannot start with `aliyun` or `acs:`.
*   The tag key cannot contain `http://` or `https://`.
*   The tag key cannot be an empty string.', example='TestKey'),
          value?: string(name='Value', description='The tag value of the backup vault. Valid values of N: 1 to 20

*   The tag value cannot start with `aliyun` or `acs:`.
*   The tag value cannot contain `http://` or `https://`.
*   The tag value cannot be an empty string.', example='TestValue'),
        }
      ](name='Tags', description='The tag information.'),
      updatedTime?: long(name='UpdatedTime', description='The time when the backup client was updated. The value is a UNIX timestamp. Unit: seconds.', example='1554347313'),
      zoneId?: string(name='ZoneId', description='This parameter is valid only if the **ClientType** parameter is set to **ECS_CLIENT**. This parameter indicates the zone of the backup client.', example='cn-hangzhou-f'),
    }
  ](name='Clients', description='The queried backup clients.', example='{\\\\"Client\\\\": []}'),
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned on each page. Valid values: 1 to 99. Default value: 10.', example='10'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
  totalCount?: long(name='TotalCount', description='The total number of returned HBR clients that meet the specified conditions.', example='8'),
}

model DescribeBackupClientsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupClientsResponseBody(name='body'),
}

/**
 * @summary Queries the information about one or more HBR clients that meet the specified conditions.
 *
 * @param tmpReq DescribeBackupClientsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupClientsResponse
 */
async function describeBackupClientsWithOptions(tmpReq: DescribeBackupClientsRequest, runtime: Util.RuntimeOptions): DescribeBackupClientsResponse {
  Util.validateModel(tmpReq);
  var request = new DescribeBackupClientsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.clientIds)) {
    request.clientIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.clientIds, 'ClientIds', 'json');
  }
  if (!Util.isUnset(tmpReq.instanceIds)) {
    request.instanceIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.instanceIds, 'InstanceIds', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.clientType)) {
    query['ClientType'] = request.clientType;
  }
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.crossAccountRoleName)) {
    query['CrossAccountRoleName'] = request.crossAccountRoleName;
  }
  if (!Util.isUnset(request.crossAccountType)) {
    query['CrossAccountType'] = request.crossAccountType;
  }
  if (!Util.isUnset(request.crossAccountUserId)) {
    query['CrossAccountUserId'] = request.crossAccountUserId;
  }
  if (!Util.isUnset(request.filters)) {
    query['Filters'] = request.filters;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientIdsShrink)) {
    body['ClientIds'] = request.clientIdsShrink;
  }
  if (!Util.isUnset(request.instanceIdsShrink)) {
    body['InstanceIds'] = request.instanceIdsShrink;
  }
  if (!Util.isUnset(request.tag)) {
    body['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBackupClients',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the information about one or more HBR clients that meet the specified conditions.
 *
 * @param request DescribeBackupClientsRequest
 * @return DescribeBackupClientsResponse
 */
async function describeBackupClients(request: DescribeBackupClientsRequest): DescribeBackupClientsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBackupClientsWithOptions(request, runtime);
}

model DescribeBackupJobs2Request {
  filters?: [ 
    {
      key?: string(name='Key', description='The keys in the filter. Valid values:

*   **RegionId**: the ID of a region
*   **PlanId**: the ID of a backup plan
*   **JobId**: the ID of a backup job
*   **VaultId**: the ID of a backup vault
*   **InstanceId**: the ID of an ECS instance
*   **Bucket**: the name of an OSS bucket
*   **FileSystemId**: the ID of a file system
*   **Status**: the status of a backup job
*   **CreatedTime**: the start time of a backup job
*   **CompleteTime**: the end time of a backup job
*   **instanceName**: the name of a Tablestore instance', example='VaultId'),
      operator?: string(name='Operator', description='The matching method. Default value: IN. This parameter specifies the operator that you want to use to match a key and a value in the filter. Valid values:

*   **EQUAL**: equal to
*   **NOT_EQUAL**: not equal to
*   **GREATER_THAN**: greater than
*   **GREATER_THAN_OR_EQUAL**: greater than or equal to
*   **LESS_THAN**: less than
*   **LESS_THAN_OR_EQUAL**: less than or equal to
*   **BETWEEN**: specifies a JSON array as a range. The results must fall within the range in the `[Minimum value,maximum value]` format.
*   **IN**: specifies an array as a collection. The results must fall within the collection.

>  If you specify **CompleteTime** as a key to query backup jobs, you cannot use the IN operator to perform a match.', example='IN'),
      values?: [ string ](name='Values', description='The values that you want to match in the filter.'),
    }
  ](name='Filters', description='The keys that you want to match in the filter.'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values: 1 to 99. Default value: 10.', example='10'),
  sortDirection?: string(name='SortDirection', description='The order in which you want to sort the results. Valid values:

*   **ASCEND**: sorts the results in ascending order
*   **DESCEND** (default value): sorts the results in descending order', example='DESCEND'),
  sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **ECS_FILE**: Elastic Compute Service (ECS) files
*   **OSS**: Object Storage Service (OSS) buckets
*   **NAS**: Apsara File Storage NAS file systems
*   **OTS**: Tablestore instances
*   **UDM_ECS**: ECS instances
*   **UDM_ECS_DISK**: ECS disks', example='ECS_FILE'),
}

model DescribeBackupJobs2ResponseBody = {
  backupJobs?: {
    backupJob?: [ 
    {
      actualBytes?: long(name='ActualBytes', description='The actual amount of data that is backed up after duplicates are removed. Unit: bytes.', example='600'),
      actualFiles?: long(name='ActualFiles', description='The number of files that are actually processed.', example='8'),
      actualItems?: long(name='ActualItems', description='This parameter is returned only if the **SourceType** parameter is set to **ECS_FILE**. This parameter indicates the actual number of objects that are backed up by the backup job.', example='6'),
      backupType?: string(name='BackupType', description='The backup type. Valid value: **COMPLETE**, which indicates full backup.', example='COMPLETE'),
      bucket?: string(name='Bucket', description='This parameter is returned only if the **SourceType** parameter is set to **OSS**. This parameter indicates the name of the OSS bucket that is backed up.', example='hbr-backup-oss'),
      bytesDone?: long(name='BytesDone', description='The actual amount of data that is generated by incremental backups. Unit: bytes.', example='800'),
      bytesTotal?: long(name='BytesTotal', description='The total amount of data that is backed up from the data source. Unit: bytes.', example='1000'),
      changeListPath?: string(name='ChangeListPath', description='The data source details at the destination. Thisparameter is returned only for data synchronization.', example='{"dataSourceId": "ds-123456789", "path": "/changelist"}'),
      clientId?: string(name='ClientId', description='This parameter is returned only if the **SourceType** parameter is set to **ECS_FILE**. This parameter indicates the ID of the backup client.', example='c-*********************'),
      completeTime?: long(name='CompleteTime', description='The time when the backup job was completed. This value is a UNIX timestamp. Unit: seconds.', example='1554347313'),
      createTime?: long(name='CreateTime', description='This parameter is returned only if the **SourceType** parameter is set to **NAS**. This parameter indicates the time when the file system was created. This value is a UNIX timestamp. Unit: seconds.', example='1607436917'),
      createdTime?: long(name='CreatedTime', description='The time when the backup job was created. This value is a UNIX timestamp. Unit: seconds.', example='1554347313'),
      crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the RAM role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='BackupRole'),
      crossAccountType?: string(name='CrossAccountType', description='Specifies whether data is backed up within the same Alibaba Cloud account or across Alibaba Cloud accounts. Valid values:

*   SELF_ACCOUNT: Data is backed up within the same Alibaba Cloud account.
*   CROSS_ACCOUNT: Data is backed up across Alibaba Cloud accounts.', example='SELF_ACCOUNT'),
      crossAccountUserId?: long(name='CrossAccountUserId', description='The ID of the source Alibaba Cloud account that authorizes the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='158975xxxxx4625'),
      destDataSourceDetail?: string(name='DestDataSourceDetail', description='Destination data source details. (Required only for synchronization)', example='{\\\\"prefix\\\\":\\\\"/\\\\"}'),
      destDataSourceId?: string(name='DestDataSourceId', description='Destination data source ID. (Required only for synchronization)', example='ds-000cov4ufudxklj24zdk'),
      destSourceType?: string(name='DestSourceType', description='Destination data source type. (Required only for synchronization)', example='OSS'),
      detail?: {
        destinationNativeSnapshotErrorMessage?: string(name='DestinationNativeSnapshotErrorMessage', description='The information about the remote replication failure.', example='ECS.CreatingSnapshot'),
        destinationNativeSnapshotId?: string(name='DestinationNativeSnapshotId', description='The ID of the remote replication snapshot.', example='s-******************'),
        destinationNativeSnapshotProgress?: int32(name='DestinationNativeSnapshotProgress', description='The progress of the remote replication.', example='85'),
        destinationNativeSnapshotStatus?: string(name='DestinationNativeSnapshotStatus', description='The state of the remote replication.', example='COMPLETE'),
        destinationRetention?: long(name='DestinationRetention', description='The retention period of the remote replication backup.', example='30'),
        destinationSnapshotId?: string(name='DestinationSnapshotId', description='The ID of the remote replication backup.', example='s-******************'),
        diskNativeSnapshotIdList?: {
          diskNativeSnapshotId?: [ string ](name='DiskNativeSnapshotId')
        }(name='DiskNativeSnapshotIdList', description='The mapping between snapshots and disks.'),
        doCopy?: boolean(name='DoCopy', description='Indicates whether remote replication is enabled.', example='true'),
        instanceInfos?: map[string]any(name='InstanceInfos', description='The ecs instance infos.', example='{
  "i-xxxxxxxx": {
    "hostName": "test",
    "instanceName": "test",
    "instanceType": "ecs.c7.xlarge",
    "osType": "linux",
    "diskIds": [
      "d-xxxxxxxx01",
      "d-xxxxxxxx02"
    ],
    "osNameEn": "Rocky Linux 8.8 64 bit",
    "osName": "Rocky Linux 8.8 64位",
    "platform": "Rocky Linux"
  }
}'),
        nativeSnapshotId?: string(name='NativeSnapshotId', description='The ID of the backup snapshot.', example='s-******************'),
      }(name='Detail', description='The udm backup job detail.'),
      errorMessage?: string(name='ErrorMessage', description='The error message that is returned for the backup job.', example='PARTIAL_COMPLETE'),
      exclude?: string(name='Exclude', description='This parameter is returned only if the **SourceType** parameter is set to **ECS_FILE**. This parameter indicates the paths to the files that are excluded from the backup job. The value must be 1 to 255 characters in length.', example='["/var", "/proc"]'),
      fileSystemId?: string(name='FileSystemId', description='This parameter is returned only if the **SourceType** parameter is set to **NAS**. This parameter indicates the ID of the NAS file system.', example='005494'),
      filesDone?: long(name='FilesDone', description='The number of files that have been processed.', example='9'),
      filesTotal?: long(name='FilesTotal', description='The total number of files to be processed.', example='10'),
      identifier?: string(name='Identifier', description='The identifier of the container cluster. For a Container Service for Kubernetes (ACK) cluster, specify the cluster ID.', example='c83**************************b76'),
      include?: string(name='Include', description='The paths to the files that are included in the backup job.', example='["/home/alice/*.pdf", "/home/bob/*.txt"]'),
      instanceId?: string(name='InstanceId', description='This parameter is returned only if the **SourceType** parameter is set to **NAS**. This parameter indicates the ID of the ECS instance.', example='i-*********************'),
      instanceName?: string(name='InstanceName', description='The name of the Tablestore instance.', example='instancename'),
      itemsDone?: long(name='ItemsDone', description='This parameter is returned only if the **SourceType** parameter is set to **ECS_FILE**. This parameter indicates the number of objects that are backed up.', example='8'),
      itemsTotal?: long(name='ItemsTotal', description='This parameter is returned only if the **SourceType** parameter is set to **ECS_FILE**. This parameter indicates the total number of objects in the data source.', example='10'),
      jobId?: string(name='JobId', description='The ID of the backup job.', example='job-000g********w7'),
      jobName?: string(name='JobName', description='The name of the backup job.', example='jobname'),
      options?: string(name='Options', description='This parameter is returned only if the **SourceType** parameter is set to **ECS_FILE**. This parameter indicates whether Windows VSS is used to define a backup path.

*   This parameter is available only for Windows ECS instances.
*   If data changes occur in the backup source, the source data must be the same as the data to be backed up before the system sets this parameter to `["UseVSS":true]`.
*   If you use VSS, you cannot back up data from multiple directories.', example='{"UseVSS":false}'),
      otsDetail?: {
        tableNames?: {
          tableName?: [ string ](name='TableName')
        }(name='TableNames', description='The names of the destination tables in the Tablestore instance.'),
      }(name='OtsDetail', description='The details about the Tablestore instance.'),
      paths?: {
        path?: [ string ](name='Path')
      }(name='Paths', description='The backup paths.'),
      planId?: string(name='PlanId', description='The ID of the backup plan.', example='plan-20********35'),
      prefix?: string(name='Prefix', description='This parameter is returned only if the **SourceType** parameter is set to **OSS**. This parameter indicates the prefix of objects that are backed up.', example='example/'),
      progress?: int32(name='Progress', description='The backup progress. For example, 10000 indicates that the progress is 100%.', example='10000'),
      report?: {
        failedFiles?: string(name='FailedFiles', description='List of failed files', example='/temp/report/158975xxxxxx4625/r-0001hfxxxxxymsspjjtl/job-0001hfxxxxxymsspjjtl_failed.zip'),
        reportTaskStatus?: string(name='ReportTaskStatus', description='Report generation status.', example='COMPLETE'),
        skippedFiles?: string(name='SkippedFiles', description='List of skipped files', example='/temp/report/158975xxxxxx4625/r-0001hfxxxxxymsspjjtl/job-0001hfxxxxxymsspjjtl_skipped.zip'),
        successFiles?: string(name='SuccessFiles', description='List of successful files.', example='/temp/report/158975xxxxxx4625/r-0001hfxxxxxymsspjjtl/job-0001hfxxxxxymsspjjtl_success.zip'),
        totalFiles?: string(name='TotalFiles', description='List of all files. (This field is not returned for data synchronization)', example='/temp/report/158975xxxxxx4625/job-0001hfxxxxxymsspjjtl/job-0001hfxxxxxymsspjjtl_total.csv'),
      }(name='Report', description='Task Report'),
      sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **ECS_FILE**: ECS files
*   **OSS**: OSS buckets
*   **NAS**: NAS file systems', example='ECS_FILE'),
      speed?: long(name='Speed', description='The average speed at which data is backed up. Unit: KB/s.', example='500'),
      speedLimit?: string(name='SpeedLimit', description='This parameter is returned only if the **SourceType** parameter is set to **ECS_FILE**. This parameter indicates the throttling rules. Format: `{start}{end}{bandwidth}`. Multiple throttling rules are separated with vertical bars (`{start}|{end}|{bandwidth}`). A specified time range cannot overlap with another one.

*   **start**: the start hour
*   **end**: the end hour
*   **bandwidth**: the bandwidth. Unit: KB/s.', example='0:24:5120'),
      startTime?: long(name='StartTime', description='The time when the backup job started. This value is a UNIX timestamp. Unit: seconds.', example='1554347313'),
      status?: string(name='Status', description='The status of the backup job. Valid values:

*   **COMPLETE**: The backup job is completed.
*   **PARTIAL_COMPLETE**: The backup job is partially completed.
*   **FAILED**: The restore job has failed.', example='COMPLETE'),
      tableName?: string(name='TableName', description='The name of a destination table in the Tablestore instance.', example='table1'),
      updatedTime?: long(name='UpdatedTime', description='The time when the backup job was updated. This value is a UNIX timestamp. Unit: seconds.', example='1554347313'),
      vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-0006******q'),
    }
  ](name='BackupJob')
  }(name='BackupJobs', description='The returned backup jobs that meet the specified conditions.'),
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned per page. Valid values: 1 to 99. Default value: 10.', example='10'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the call is successful.

*   true: The call is successful.
*   false: The call fails.', example='true'),
  totalCount?: long(name='TotalCount', description='The total number of returned backup jobs that meet the specified conditions.', example='8'),
}

model DescribeBackupJobs2Response = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupJobs2ResponseBody(name='body'),
}

/**
 * @summary Queries the information about one or more backup jobs that meet the specified conditions.
 *
 * @param request DescribeBackupJobs2Request
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupJobs2Response
 */
async function describeBackupJobs2WithOptions(request: DescribeBackupJobs2Request, runtime: Util.RuntimeOptions): DescribeBackupJobs2Response {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.filters)) {
    query['Filters'] = request.filters;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sortDirection)) {
    query['SortDirection'] = request.sortDirection;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBackupJobs2',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the information about one or more backup jobs that meet the specified conditions.
 *
 * @param request DescribeBackupJobs2Request
 * @return DescribeBackupJobs2Response
 */
async function describeBackupJobs2(request: DescribeBackupJobs2Request): DescribeBackupJobs2Response {
  var runtime = new Util.RuntimeOptions{};
  return describeBackupJobs2WithOptions(request, runtime);
}

model DescribeBackupPlansRequest {
  filters?: [ 
    {
      key?: string(name='Key', description='The keys in the filter. Valid values:

*   **regionId**: the ID of a region
*   **planId**: the ID of a backup plan
*   **sourceType**: the type of a data source
*   **vaultId**: the ID of a backup vault
*   **instanceName**: the name of an instance
*   **instanceId**: the ID of an instance
*   **planName**: the name of a backup plan', example='vaultId'),
      values?: [ string ](name='Values', description='The values that you want to match in the filter.', example='["v-*********************"]'),
    }
  ](name='Filters', description='The filters.'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 99. Default value: 10.', example='10'),
  sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **ECS_FILE**: Elastic Compute Service (ECS) files
*   **OSS**: Object Storage Service (OSS) buckets
*   **NAS**: File Storage NAS (NAS) file systems
*   **OTS**: Tablestore instances
*   **UDM_ECS**: ECS instances
*   **SYNC**: data synchronization', example='ECS_FILE'),
}

model DescribeBackupPlansResponseBody = {
  backupPlans?: {
    backupPlan?: [ 
    {
      backupSourceGroupId?: string(name='BackupSourceGroupId', description='The ID of the data source group.', example='System-Database'),
      backupType?: string(name='BackupType', description='The backup type. Valid value: **COMPLETE**, which indicates full backup.', example='COMPLETE'),
      bucket?: string(name='Bucket', description='This parameter is valid only when **SourceType** is set to **OSS**. This parameter indicates the name of the OSS bucket.', example='hbr-backup-oss'),
      changeListPath?: string(name='ChangeListPath', description='The configurations of the incremental file synchronization. This parameter is returned only for data synchronization.', example='{"dataSourceId": "ds-123456789", "path": "/changelist"}'),
      clientId?: string(name='ClientId', description='The ID of the backup client.', example='c-000ge4w*****1qb'),
      clusterId?: string(name='ClusterId', description='The ID of the client group.', example='cl-000ht6o9******h'),
      createTime?: long(name='CreateTime', description='This parameter is valid only when **SourceType** is set to **NAS**. This parameter indicates the time when the file system was created. This value is a UNIX timestamp. Unit: seconds.', example='1554347313'),
      createdByTag?: boolean(name='CreatedByTag', description='Indicates whether a backup plan is automatically created based on tags.', example='false'),
      createdTime?: long(name='CreatedTime', description='The time when the backup plan was created. This value is a UNIX timestamp. Unit: seconds.', example='1554347313'),
      crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the Resource Access Management (RAM) role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='BackupRole'),
      crossAccountType?: string(name='CrossAccountType', description='Indicates whether data is backed up within the same Alibaba Cloud account or across Alibaba Cloud accounts. Valid values:

*   SELF_ACCOUNT
*   CROSS_ACCOUNT', example='CROSS_ACCOUNT'),
      crossAccountUserId?: long(name='CrossAccountUserId', description='The ID of the source Alibaba Cloud account that authorizes the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='1841642xxxxx9795'),
      dataSourceId?: string(name='DataSourceId', description='The ID of the data source.', example='ds-000ht6o9*****w61'),
      destDataSourceDetail?: string(name='DestDataSourceDetail', description='The data source details at the destination. This parameter is returned only for data synchronization.', example='{\\\\"prefix\\\\":\\\\"/\\\\"}'),
      destDataSourceId?: string(name='DestDataSourceId', description='The data source ID at the destination. This parameter is returned only for data synchronization.', example='ds-*********************'),
      destSourceType?: string(name='DestSourceType', description='The data source type at the destination. This parameter is returned only for data synchronization.', example='OSS'),
      detail?: string(name='Detail', description='The details about ECS instance backup.', example='{\\\\"doCopy\\\\":true,\\\\"doBackup\\\\":false,\\\\"instanceName\\\\":\\\\"instance example\\\\",\\\\"appConsistent\\\\":false,\\\\"destinationRegionId\\\\":\\\\"cn-shanghai\\\\",\\\\"enableFsFreeze\\\\":true,\\\\"osNameEn\\\\":\\\\"Windows Server  2019 Data Center Edition 64bit Chinese Edition\\\\",\\\\"osName\\\\":\\\\"Windows Server  2019 Data Center Edition 64bit Chinese Edition\\\\",\\\\"diskIdList\\\\":[],\\\\"backupVaultId\\\\":\\\\"\\\\",\\\\"snapshotGroup\\\\":true,\\\\"destinationRetention\\\\":35,\\\\"platform\\\\":\\\\"Windows Server 2012\\\\",\\\\"timeoutInSeconds\\\\":60,\\\\"backupRetention\\\\":1,\\\\"osType\\\\":\\\\"windows\\\\",\\\\"preScriptPath\\\\":\\\\"\\\\",\\\\"postScriptPath\\\\":\\\\"\\\\",\\\\"enableWriters\\\\":true,\\\\"ecsDeleted\\\\":false}'),
      disabled?: boolean(name='Disabled', description='Indicates whether the backup plan is disabled. Valid values:

*   true: The backup plan is disabled.
*   false: The backup plan is enabled.', example='false'),
      exclude?: string(name='Exclude', description='This parameter is valid only when **SourceType** is set to **ECS_FILE**. This parameter indicates the paths to the files that are excluded from the backup job.', example='["/var", "/proc"]'),
      fileSystemId?: string(name='FileSystemId', description='This parameter is valid only when **SourceType** is set to **NAS**. This parameter indicates the ID of the NAS file system.', example='00594'),
      hitTags?: {
        hitTag?: [ 
        {
          key?: string(name='Key', description='The tag key.', example='type'),
          operator?: string(name='Operator', description='The tag-based matching rule. Valid values:

*   **EQUAL**: Both the tag key and tag value are matched.
*   **NOT**: The tag key is matched and the tag value is not matched.', example='EQUAL'),
          value?: string(name='Value', description='The tag value.', example='0'),
        }
      ](name='HitTag')
      }(name='HitTags', description='The matched tag rules.'),
      include?: string(name='Include', description='This parameter is valid only when **SourceType** is set to **ECS_FILE**. This parameter indicates the paths to the files that are backed up.', example='["/home/alice/*.pdf", "/home/bob/*.txt"]'),
      instanceGroupId?: string(name='InstanceGroupId', description='The ID of the instance group.', example='i-**'),
      instanceId?: string(name='InstanceId', description='This parameter is valid only when **SourceType** is set to **ECS_FILE**. This parameter indicates the ID of the ECS instance.', example='i-*********************'),
      instanceName?: string(name='InstanceName', description='The name of the Tablestore instance.', example='instancename'),
      keepLatestSnapshots?: long(name='KeepLatestSnapshots', description='Indicates whether the feature of keeping at least one backup version is enabled. Valid values:

*   0: The feature is disabled.
*   1: The feature is enabled.', example='0'),
      latestExecuteJobId?: string(name='LatestExecuteJobId', description='The latest execution job id of plan.', example='job-12345678'),
      options?: string(name='Options', description='This parameter is valid only when **SourceType** is set to **ECS_FILE**. This parameter indicates whether Windows Volume Shadow Copy Service (VSS) is used to define a source path.', example='{"UseVSS":false}'),
      otsDetail?: {
        tableNames?: {
          tableName?: [ string ](name='TableName')
        }(name='TableNames', description='The names of the tables in the Tablestore instance.'),
      }(name='OtsDetail', description='The details about the Tablestore instance.'),
      paths?: {
        path?: [ string ](name='Path')
      }(name='Paths', description='The source paths. This parameter is valid only when **SourceType** is set to **ECS_FILE**.'),
      planId?: string(name='PlanId', description='The ID of the backup plan.', example='plan-*********************'),
      planName?: string(name='PlanName', description='The name of the backup plan.', example='planname'),
      prefix?: string(name='Prefix', description='This parameter is valid only when **SourceType** is set to **OSS**. This parameter indicates the prefix of the objects that are backed up.', example='oss-prefix'),
      resources?: {
        resource?: [ 
        {
          extra?: string(name='Extra', description='Additional information about the data source.', example='{\\\\"doBackup\\\\":false,\\\\"diskName\\\\":\\\\"data_disk\\\\",\\\\"size\\\\":100,\\\\"type\\\\":\\\\"data\\\\",\\\\"category\\\\":\\\\"cloud_essd\\\\",\\\\"imageId\\\\":\\\\"\\\\",\\\\"device\\\\":\\\\"/dev/xvdb\\\\",\\\\"encrypted\\\\":false}'),
          resourceId?: string(name='ResourceId', description='The ID of the data source.', example='d-j6cgioir6m******lu4'),
          sourceType?: string(name='SourceType', description='The type of the data source. Valid value: **UDM_DISK**.', example='UDMDISK'),
        }
      ](name='Resource')
      }(name='Resources', description='The backup resources. This parameter is valid only for disk backup.'),
      retention?: long(name='Retention', description='The retention period of the backup data. Unit: days.', example='7'),
      rules?: {
        rule?: [ 
        {
          backupType?: string(name='BackupType', description='The backup type. Valid value: **COMPLETE**, which indicates full backup.', example='COMPLETE'),
          destinationRegionId?: string(name='DestinationRegionId', description='The ID of the region in which the remote backup vault resides.', example='cn-shanghai'),
          destinationRetention?: long(name='DestinationRetention', description='The retention period of the backup data in remote backup mode. Unit: days.', example='90'),
          disabled?: boolean(name='Disabled', description='Indicates whether the policy is disabled.', example='true'),
          doCopy?: boolean(name='DoCopy', description='Indicates whether the snapshot data is backed up to the backup vault.', example='false'),
          retention?: long(name='Retention', description='The retention period of the backup data. Unit: days.', example='90'),
          ruleId?: string(name='RuleId', description='The policy ID.', example='rule-0008i52rf0ulpni6kn6m'),
          ruleName?: string(name='RuleName', description='The policy name.', example='Disk Golden Rule'),
          schedule?: string(name='Schedule', description='The backup policy. Format: `I|{startTime}|{interval}`. The system runs the first backup job at a point in time that is specified by `{startTime}` and the subsequent backup jobs at an interval that is specified by `{interval}`. The system does not run a backup job before the specified point in time. Each backup job, except the first one, starts only after the previous backup job is completed. For example, `I|1631685600|P1D` indicates that the system runs the first backup job at 14:00:00 on September 15, 2021 and the subsequent backup jobs once a day.

*   `startTime`: the time at which the system starts to run a backup job. The time follows the UNIX time format. Unit: seconds.
*   `interval`: the interval at which the system runs a backup job. The interval follows the ISO 8601 standard. For example, PT1H indicates an interval of 1 hour. P1D indicates an interval of one day.', example='I|1631685600|P1D'),
        }
      ](name='Rule')
      }(name='Rules', description='The backup policies. This parameter is valid only for disk backup.'),
      schedule?: string(name='Schedule', description='The backup policy. Format: `I|{startTime}|{interval}`. The system runs the first backup job at a point in time that is specified by `{startTime}` and the subsequent backup jobs at an interval that is specified by `{interval}`. The system does not run a backup job before the specified point in time. Each backup job, except the first one, starts only after the previous backup job is completed. For example, `I|1631685600|P1D` indicates that the system runs the first backup job at 14:00:00 on September 15, 2021 and the subsequent backup jobs once a day.

*   **startTime**: the time at which the system starts to run a backup job. The time follows the UNIX time format. Unit: seconds.
*   **interval**: the interval at which the system runs a backup job. The interval follows the ISO 8601 standard. For example, PT1H indicates an interval of 1 hour. P1D indicates an interval of one day.', example='I|1602673264|P1D'),
      sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **ECS_FILE**: ECS files
*   **OSS**: OSS buckets
*   **NAS**: NAS file systems
*   **OTS**: Tablestore instances
*   **UDM_ECS**: ECS instances
*   **SYNC**: data synchronization', example='ECS_FILE'),
      speedLimit?: string(name='SpeedLimit', description='This parameter is valid only when **SourceType** is set to **ECS_FILE**. This parameter indicates the throttling rules. Format: `{start}|{end}|{bandwidth}`. Multiple throttling rules are separated with vertical bars (`|`). A time range cannot overlap with another one.

*   start: the start hour.
*   end: the end hour.
*   bandwidth: the bandwidth. Unit: KB.', example='0:24:5120'),
      trialInfo?: {
        keepAfterTrialExpiration?: boolean(name='KeepAfterTrialExpiration', description='Indicates whether you are billed based on the pay-as-you-go method after the free trial ends.', example='true'),
        trialExpireTime?: long(name='TrialExpireTime', description='The expiration time of the free trial.', example='1584597600'),
        trialStartTime?: long(name='TrialStartTime', description='The start time of the free trial.', example='1579413159'),
        trialVaultReleaseTime?: long(name='TrialVaultReleaseTime', description='The time when the free-trial backup vault is released.', example='1594965600'),
      }(name='TrialInfo', description='The free trial information.'),
      updatedTime?: long(name='UpdatedTime', description='The time when the backup plan was updated. This value is a UNIX timestamp. Unit: seconds.', example='1554347313'),
      vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-*********************'),
    }
  ](name='BackupPlan')
  }(name='BackupPlans', description='The queried backup plans.'),
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned on each page. Valid values: 1 to 99. Default value: 10.', example='10'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
  totalCount?: long(name='TotalCount', description='The total number of returned backup plans that meet the specified conditions.', example='8'),
}

model DescribeBackupPlansResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupPlansResponseBody(name='body'),
}

/**
 * @summary Queries the information about one or more backup plans that meet the specified conditions.
 *
 * @param request DescribeBackupPlansRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupPlansResponse
 */
async function describeBackupPlansWithOptions(request: DescribeBackupPlansRequest, runtime: Util.RuntimeOptions): DescribeBackupPlansResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.filters)) {
    query['Filters'] = request.filters;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBackupPlans',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the information about one or more backup plans that meet the specified conditions.
 *
 * @param request DescribeBackupPlansRequest
 * @return DescribeBackupPlansResponse
 */
async function describeBackupPlans(request: DescribeBackupPlansRequest): DescribeBackupPlansResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBackupPlansWithOptions(request, runtime);
}

model DescribeClientsRequest {
  clientId?: string(name='ClientId', description='The ID of the Cloud Backup client.', example='c-000ed600******6b0'),
  clientType?: string(name='ClientType', description='The type of the Cloud Backup client. Valid value: **ECS_AGENT**, which indicates an SAP HANA backup client.', example='ECS_AGENT'),
  clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance.', example='cl-0005ni1******2l87'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 99. Default value: 10.', example='10'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmw6bxl7o5qyq'),
  sourceType?: string(name='SourceType', description='The type of the data source. Valid value:**HANA**, which indicates SAP HANA backup.', example='HANA'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-0001vk0z******xdyr'),
}

model DescribeClientsResponseBody = {
  clients?: {
    client?: [ 
    {
      alertSetting?: string(name='AlertSetting', description='The alert settings. Valid value: INHERITED, which indicates that the Cloud Backup client sends alert notifications by using the same method configured for the backup vault.', example='INHERITED'),
      clientId?: string(name='ClientId', description='The ID of the Cloud Backup client.', example='c-00062uu******2fgj'),
      clientName?: string(name='ClientName', description='The client name.', example='client-20211224-101226'),
      clientType?: string(name='ClientType', description='The type of the Cloud Backup client. Valid value: **ECS_AGENT**, which indicates an SAP HANA backup client.', example='ECS_AGENT'),
      clientVersion?: string(name='ClientVersion', description='The version number of the Cloud Backup client.', example='1.11.16'),
      clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance.', example='cl-0008c48frr******ncpk'),
      createdTime?: long(name='CreatedTime', description='The time when the Cloud Backup client was created.', example='1554347313'),
      heartBeatTime?: long(name='HeartBeatTime', description='The latest heartbeat time of the Cloud Backup client. This value is a UNIX timestamp. Unit: seconds.', example='1554347313'),
      instanceId?: string(name='InstanceId', description='The instance ID.', example='i-wz9b6wya******n8yo'),
      instanceName?: string(name='InstanceName', description='The name of the ECS instance.', example='swh-hbr'),
      maxVersion?: string(name='MaxVersion', description='The maximum version number of the Cloud Backup client.', example='1.11.23'),
      networkType?: string(name='NetworkType', description='The network type. Valid values:

*   **CLASSIC**: the classic network
*   **VPC**: the virtual private cloud (VPC)', example='VPC'),
      status?: string(name='Status', description='The status of the Cloud Backup client. Valid values:

*   **REGISTERED**: The backup client is registered.
*   **ACTIVATED**: The backup client is activated.
*   **DEACTIVATED**: The backup client fails to be activated.
*   **INSTALLING**: The backup client is being installed.
*   **INSTALL_FAILED**: The backup client fails to be installed.
*   **NOT_INSTALLED**: The backup client is not installed.
*   **UPGRADING**: The backup client is being upgraded.
*   **UPGRADE_FAILED**: The backup client fails to be upgraded.
*   **UNINSTALLING**: The backup client is being uninstalled.
*   **UNINSTALL_FAILED**: The backup client fails to be uninstalled.
*   **STOPPED**: The backup client is out of service.
*   **UNKNOWN**: The backup client is disconnected.', example='ACTIVATED'),
      statusMessage?: string(name='StatusMessage', description='The status information.', example='HANA_NOT_SUPPORT'),
      updatedTime?: long(name='UpdatedTime', description='The time when the Cloud Backup client was updated. This value is a UNIX timestamp. Unit: seconds.', example='1554347313'),
      useHttps?: boolean(name='UseHttps', description='Indicates whether data is transmitted over HTTPS. Valid values:

*   true: Data is transmitted over HTTPS.
*   false: Data is transmitted over HTTP.', example='false'),
      vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-00029mx6o******n85lg'),
    }
  ](name='Client')
  }(name='Clients', description='The Cloud Backup clients.'),
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 99. Default value: 10.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='17189276-465D-5EF3-8FFD-0FF51B5A41A0'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='12'),
}

model DescribeClientsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeClientsResponseBody(name='body'),
}

/**
 * @summary Queries one or more Cloud Backup clients that meet the specified conditions.
 *
 * @description This operation is applicable only to SAP HANA backup. For Cloud Backup clients of other data sources, call the DescribeBackupClients operation.
 *
 * @param request DescribeClientsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeClientsResponse
 */
async function describeClientsWithOptions(request: DescribeClientsRequest, runtime: Util.RuntimeOptions): DescribeClientsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientId)) {
    query['ClientId'] = request.clientId;
  }
  if (!Util.isUnset(request.clientType)) {
    query['ClientType'] = request.clientType;
  }
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeClients',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries one or more Cloud Backup clients that meet the specified conditions.
 *
 * @description This operation is applicable only to SAP HANA backup. For Cloud Backup clients of other data sources, call the DescribeBackupClients operation.
 *
 * @param request DescribeClientsRequest
 * @return DescribeClientsResponse
 */
async function describeClients(request: DescribeClientsRequest): DescribeClientsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeClientsWithOptions(request, runtime);
}

model DescribeContainerClusterRequest {
  clusterId?: string(name='ClusterId', description='The cluster ID.', example='cc-000*************hg9'),
  identifier?: string(name='Identifier', description='The identifier of the container cluster. For a Container Service for Kubernetes (ACK) cluster, specify the cluster ID.', example='cca*******************************87a'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values: 1 to 99. Default value: 10.', example='10'),
}

model DescribeContainerClusterResponseBody = {
  clusters?: [ 
    {
      agentStatus?: string(name='AgentStatus', description='The status of the client. Valid values:

*   **MISS**: The client is disconnected.
*   **UNKNOWN**: The client is in an unknown state.
*   **READY**: The client is ready.', example='READY'),
      clusterId?: string(name='ClusterId', description='The ID of the cluster.', example='cl-0006gwppd0jtttpmb0ri'),
      clusterType?: string(name='ClusterType', description='The type of the cluster. Valid value: ACK, which indicates ACK clusters.', example='ACK'),
      description?: string(name='Description', description='The description.', example='description ack pv backup'),
      identifier?: string(name='Identifier', description='The identifier of the cluster.', example='c5bbd0931a30947f4ab85efd19380a72d'),
      name?: string(name='Name', description='The name of the instance.', example='ack_pv_backup_location'),
      networkType?: string(name='NetworkType', description='The network type of the cluster. Valid values:

*   **CLASSIC**: the classic network
*   **VPC**: virtual private cloud (VPC)', example='VPC'),
      token?: string(name='Token', description='The token that is used to register the Hybrid Backup Recovery (HBR) client in the cluster.', example='eyJhY2Nvd******A/VnZpgXQC5A=='),
    }
  ](name='Clusters', description='The information of clusters.'),
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned on each page. Valid values: 1 to 99. Default value: 10.', example='100'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CC94B755-C3C2-5B9D-BD77-E0FE819A4DB2'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
  totalCount?: long(name='TotalCount', description='The total number of returned entries.', example='8'),
}

model DescribeContainerClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeContainerClusterResponseBody(name='body'),
}

/**
 * @summary Queries one or more container clusters that meet the specified conditions.
 *
 * @description You can call this operation to query only Container Service for Kubernetes (ACK) clusters.
 *
 * @param request DescribeContainerClusterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeContainerClusterResponse
 */
async function describeContainerClusterWithOptions(request: DescribeContainerClusterRequest, runtime: Util.RuntimeOptions): DescribeContainerClusterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.identifier)) {
    query['Identifier'] = request.identifier;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeContainerCluster',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries one or more container clusters that meet the specified conditions.
 *
 * @description You can call this operation to query only Container Service for Kubernetes (ACK) clusters.
 *
 * @param request DescribeContainerClusterRequest
 * @return DescribeContainerClusterResponse
 */
async function describeContainerCluster(request: DescribeContainerClusterRequest): DescribeContainerClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeContainerClusterWithOptions(request, runtime);
}

model DescribeCrossAccountsRequest {
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 99. Default value: 10.', example='10'),
}

model DescribeCrossAccountsResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the request was successful.', example='200'),
  crossAccounts?: {
    crossAccount?: [ 
    {
      alias?: string(name='Alias', description='The account alias. The value can be up to 32 bits in length.', example='content'),
      createdTime?: long(name='CreatedTime', description='The time when the account was created. This value is a UNIX timestamp. Unit: seconds.', example='1654570439'),
      crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the RAM role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='BackupRole'),
      crossAccountUserId?: long(name='CrossAccountUserId', description='The ID of the source Alibaba Cloud account that authorizes the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='15897534xxxxx625'),
      id?: long(name='Id', description='The ID of the backup type.', example='1'),
      ownerId?: long(name='OwnerId', description='The ID of the current account.', example='184164xxxxx49795'),
      updatedTime?: long(name='UpdatedTime', description='The time when the account information was updated. The value is a UNIX timestamp. Unit: seconds.', example='1640157098'),
    }
  ](name='CrossAccount')
  }(name='CrossAccounts', description='The information about the accounts used in cross-account backup.'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 99. Default value: 10.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='22'),
}

model DescribeCrossAccountsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCrossAccountsResponseBody(name='body'),
}

/**
 * @summary Queries the information about the accounts used in cross-account backup.
 *
 * @param request DescribeCrossAccountsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCrossAccountsResponse
 */
async function describeCrossAccountsWithOptions(request: DescribeCrossAccountsRequest, runtime: Util.RuntimeOptions): DescribeCrossAccountsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCrossAccounts',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the information about the accounts used in cross-account backup.
 *
 * @param request DescribeCrossAccountsRequest
 * @return DescribeCrossAccountsResponse
 */
async function describeCrossAccounts(request: DescribeCrossAccountsRequest): DescribeCrossAccountsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCrossAccountsWithOptions(request, runtime);
}

model DescribeHanaBackupPlansRequest {
  clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance.

This parameter is required.', example='cl-000chxz******lz7bk'),
  databaseName?: string(name='DatabaseName', description='The database name.', example='SYSTEMDB'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 99. Default value: 10.', example='10'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmvywqfey5njq'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-000i4lg4kz******ahl'),
}

model DescribeHanaBackupPlansResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  hanaBackupPlans?: {
    hanaBackupPlan?: [ 
    {
      backupPrefix?: string(name='BackupPrefix', description='The backup prefix.', example='COMPLETE_DATA_BACKUP'),
      backupType?: string(name='BackupType', description='The backup type. Valid values:

*   COMPLETE: full backup
*   INCREMENTAL: incremental backup
*   DIFFERENTIAL: differential backup', example='COMPLETE'),
      clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance.', example='cl-0002scknka*****'),
      databaseName?: string(name='DatabaseName', description='The database name.', example='SYSTEMDB'),
      disabled?: boolean(name='Disabled', description='Indicates whether the backup plan is disabled. Valid values:

*   true: The backup plan is disabled.
*   false: The backup plan is enabled.', example='false'),
      planId?: string(name='PlanId', description='The ID of the backup plan.', example='pl-0000tnyndg3ne5m4ubeu'),
      planName?: string(name='PlanName', description='The name of the backup plan.', example='plan-20220118-141153'),
      schedule?: string(name='Schedule', description='The backup policy. Format: `I|{startTime}|{interval}`. The system runs the first backup job at a point in time that is specified in the {startTime} parameter and the subsequent backup jobs at an interval that is specified in the {interval} parameter. The system does not run a backup job before the specified point in time. Each backup job, except the first one, starts only after the previous backup job is completed. For example, `I|1631685600|P1D` indicates that the system runs the first backup job at 14:00:00 on September 15, 2021 and the subsequent backup jobs once a day.

*   startTime: the time at which the system starts to run a backup job. The time follows the UNIX time format. Unit: seconds.
*   interval: the interval at which the system runs a backup job. The interval follows the ISO 8601 standard. For example, PT1H indicates an interval of 1 hour. P1D indicates an interval of one day.', example='I|1602673264|P1D'),
      vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-000csihw82pqkd7hcjws'),
    }
  ](name='HanaBackupPlan')
  }(name='HanaBackupPlans', description='The details of the backup plan.'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 99. Default value: 10.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='F029C1C7-26B6-5ADD-A73E-D85CCD7C73A9'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='6'),
}

model DescribeHanaBackupPlansResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHanaBackupPlansResponseBody(name='body'),
}

/**
 * @summary Queries one or more SAP HANA backup plans that meet the specified conditions.
 *
 * @param request DescribeHanaBackupPlansRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHanaBackupPlansResponse
 */
async function describeHanaBackupPlansWithOptions(request: DescribeHanaBackupPlansRequest, runtime: Util.RuntimeOptions): DescribeHanaBackupPlansResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.databaseName)) {
    query['DatabaseName'] = request.databaseName;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHanaBackupPlans',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries one or more SAP HANA backup plans that meet the specified conditions.
 *
 * @param request DescribeHanaBackupPlansRequest
 * @return DescribeHanaBackupPlansResponse
 */
async function describeHanaBackupPlans(request: DescribeHanaBackupPlansRequest): DescribeHanaBackupPlansResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHanaBackupPlansWithOptions(request, runtime);
}

model DescribeHanaBackupSettingRequest {
  clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance.

This parameter is required.', example='cl-00068btz******oku'),
  databaseName?: string(name='DatabaseName', description='The name of the database.', example='SYSTEMDB'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-000css******za5uyqr'),
}

model DescribeHanaBackupSettingResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  hanaBackupSetting?: {
    catalogBackupParameterFile?: string(name='CatalogBackupParameterFile', description='The configuration file for catalog backup.', example='/usr/sap/SID/SYS/global/hdb/opt/hdbconfig/param'),
    catalogBackupUsingBackint?: boolean(name='CatalogBackupUsingBackint', description='Indicates whether Backint is used to back up catalogs. Valid values:

*   true: Backint is used to back up catalogs.
*   false: Backint is not used to back up catalogs.', example='false'),
    dataBackupParameterFile?: string(name='DataBackupParameterFile', description='The configuration file for data backup.', example='/usr/sap/SID/SYS/global/hdb/opt/hdbconfig/param'),
    databaseName?: string(name='DatabaseName', description='The name of the database.', example='SYSTEMDB'),
    enableAutoLogBackup?: boolean(name='EnableAutoLogBackup', description='Indicates whether automatic log backup is enabled. Valid values:

*   **true**: Automatic log backup is enabled.
*   **false**: Automatic log backup is disabled.', example='true'),
    logBackupParameterFile?: string(name='LogBackupParameterFile', description='The configuration file for log backup.', example='/usr/sap/SID/SYS/global/hdb/opt/hdbconfig/param'),
    logBackupTimeout?: long(name='LogBackupTimeout', description='The interval at which logs are backed up. Unit: seconds.', example='900'),
    logBackupUsingBackint?: boolean(name='LogBackupUsingBackint', description='Indicates whether Backint is used to back up logs. Valid values:

*   true: Backint is used to back up logs.
*   false: Backint is not used to back up logs.', example='true'),
  }(name='HanaBackupSetting', description='The backup settings.'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='9D0DB5BC-5071-5ADF-BCD1-14EBB0C17C54'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
}

model DescribeHanaBackupSettingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHanaBackupSettingResponseBody(name='body'),
}

/**
 * @summary Queries the backup parameters of an SAP HANA database.
 *
 * @description If you want to query the backup retention period of a database, you can call the DescribeHanaRetentionSetting operation.
 *
 * @param request DescribeHanaBackupSettingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHanaBackupSettingResponse
 */
async function describeHanaBackupSettingWithOptions(request: DescribeHanaBackupSettingRequest, runtime: Util.RuntimeOptions): DescribeHanaBackupSettingResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.databaseName)) {
    query['DatabaseName'] = request.databaseName;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHanaBackupSetting',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the backup parameters of an SAP HANA database.
 *
 * @description If you want to query the backup retention period of a database, you can call the DescribeHanaRetentionSetting operation.
 *
 * @param request DescribeHanaBackupSettingRequest
 * @return DescribeHanaBackupSettingResponse
 */
async function describeHanaBackupSetting(request: DescribeHanaBackupSettingRequest): DescribeHanaBackupSettingResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHanaBackupSettingWithOptions(request, runtime);
}

model DescribeHanaBackupsAsyncRequest {
  clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance.

This parameter is required.', example='cl-00098******yuqvu'),
  databaseName?: string(name='DatabaseName', description='The database name.', example='BPD'),
  includeDifferential?: boolean(name='IncludeDifferential', description='Specifies whether to include differential backups in the query results. Valid values:

*   true: includes differential backups.
*   false: excludes differential backups.', example='false'),
  includeIncremental?: boolean(name='IncludeIncremental', description='Specifies whether to include incremental backups in the query results. Valid values:

*   true: includes incremental backups.
*   false: excludes incremental backups.', example='true'),
  includeLog?: boolean(name='IncludeLog', description='Specifies whether to include log backups in the query results. Valid values:

*   true: includes log backups.
*   false: excludes log backups.', example='true'),
  logPosition?: long(name='LogPosition', description='The log position to which you want to restore the database. This parameter is valid only if you set the Mode parameter to **RECOVERY_TO_LOG_POSITION**.', example='0'),
  mode?: string(name='Mode', description='The recovery mode. Valid values:

*   **RECOVERY_TO_MOST_RECENT**: restores the database to the recently available state to which the database has been backed up.
*   **RECOVERY_TO_POINT_IN_TIME**: restores the database to a specified point in time.
*   **RECOVERY_TO_SPECIFIC_BACKUP**: restores the database to a specified backup.
*   **RECOVERY_TO_LOG_POSITION**: restores the database to a specified log position.', example='RECOVERY_TO_SPECIFIC_BACKUP'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 99. Default value: 10.', example='10'),
  recoveryPointInTime?: long(name='RecoveryPointInTime', description='The point in time to which you want to restore the database. This parameter is valid only if you set the Mode parameter to **RECOVERY_TO_POINT_IN_TIME**. Cloud Backup restores the database to a state closest to the specified point in time.', example='1649851200'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmz7mced2ldhy'),
  source?: string(name='Source', description='The name of the source system. This parameter specifies the name of the source database that you want to restore. You must set the parameter in the `<Source database name>@SID` format.', example='P01@HP1'),
  sourceClusterId?: string(name='SourceClusterId', description='The ID of the source SAP HANA instance.', example='cl-0000g3m******5cj'),
  systemCopy?: boolean(name='SystemCopy', description='Specifies whether to restore the database to a different instance.

*   true: restores the database to a different instance.
*   false: restores the database within the same instance.', example='true'),
  useBackint?: boolean(name='UseBackint', description='Specifies whether Backint is used. Valid values:

*   true: Backint is used.
*   false: Backint is not used.', example='false'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-000270c******pi81'),
  volumeId?: int32(name='VolumeId', description='The ID of the volume that you want to restore. This parameter is valid only if you set the Mode parameter to **RECOVERY_TO_LOG_POSITION**.', example='0'),
}

model DescribeHanaBackupsAsyncResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='31F97233-8563-563D-8880-914B00EEA928'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  taskId?: string(name='TaskId', description='The ID of the asynchronous job. You can call the DescribeTask operation to query the execution result of an asynchronous job.', example='t-0006xmbplrqebt9dhkth'),
}

model DescribeHanaBackupsAsyncResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHanaBackupsAsyncResponseBody(name='body'),
}

/**
 * @summary Queries one or more SAP HANA backups that meet the specified conditions.
 *
 * @description After you call the DescribeHanaBackupsAsync operation to query the SAP HANA backups that meet the specified conditions, call the DescribeTask operation to query the final result.
 *
 * @param request DescribeHanaBackupsAsyncRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHanaBackupsAsyncResponse
 */
async function describeHanaBackupsAsyncWithOptions(request: DescribeHanaBackupsAsyncRequest, runtime: Util.RuntimeOptions): DescribeHanaBackupsAsyncResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.databaseName)) {
    query['DatabaseName'] = request.databaseName;
  }
  if (!Util.isUnset(request.includeDifferential)) {
    query['IncludeDifferential'] = request.includeDifferential;
  }
  if (!Util.isUnset(request.includeIncremental)) {
    query['IncludeIncremental'] = request.includeIncremental;
  }
  if (!Util.isUnset(request.includeLog)) {
    query['IncludeLog'] = request.includeLog;
  }
  if (!Util.isUnset(request.logPosition)) {
    query['LogPosition'] = request.logPosition;
  }
  if (!Util.isUnset(request.mode)) {
    query['Mode'] = request.mode;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.recoveryPointInTime)) {
    query['RecoveryPointInTime'] = request.recoveryPointInTime;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  if (!Util.isUnset(request.sourceClusterId)) {
    query['SourceClusterId'] = request.sourceClusterId;
  }
  if (!Util.isUnset(request.systemCopy)) {
    query['SystemCopy'] = request.systemCopy;
  }
  if (!Util.isUnset(request.useBackint)) {
    query['UseBackint'] = request.useBackint;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  if (!Util.isUnset(request.volumeId)) {
    query['VolumeId'] = request.volumeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHanaBackupsAsync',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries one or more SAP HANA backups that meet the specified conditions.
 *
 * @description After you call the DescribeHanaBackupsAsync operation to query the SAP HANA backups that meet the specified conditions, call the DescribeTask operation to query the final result.
 *
 * @param request DescribeHanaBackupsAsyncRequest
 * @return DescribeHanaBackupsAsyncResponse
 */
async function describeHanaBackupsAsync(request: DescribeHanaBackupsAsyncRequest): DescribeHanaBackupsAsyncResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHanaBackupsAsyncWithOptions(request, runtime);
}

model DescribeHanaDatabasesRequest {
  clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance.

This parameter is required.', example='cl-000hpc******uv14x'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 99. Default value: 10.', example='10'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmw2azsegupmi'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-00063fq******8xjr'),
}

model DescribeHanaDatabasesResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  hanaDatabases?: {
    hanaDatabase?: [ 
    {
      activeStatus?: string(name='ActiveStatus', description='Indicates whether the database is started. Valid values:

*   **YES**: The database is started.
*   **NO**: The database is not started.', example='YES'),
      databaseName?: string(name='DatabaseName', description='The database name.', example='SYSTEMDB'),
      detail?: string(name='Detail', description='The detailed information.', example='master'),
      host?: string(name='Host', description='The hostname.', example='izbp1jbf3zy******antqmz'),
      serviceName?: string(name='ServiceName', description='The service name.', example='indexserver'),
      sqlPort?: int32(name='SqlPort', description='The port number.', example='30013'),
    }
  ](name='HanaDatabase')
  }(name='HanaDatabases', description='The information about SAP HANA databases.'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 99. Default value: 10.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='DAAB6A29-34EB-5F56-962F-D5BDBFE8A5C2'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='10'),
}

model DescribeHanaDatabasesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHanaDatabasesResponseBody(name='body'),
}

/**
 * @summary Queries the information about SAP HANA databases.
 *
 * @description After you register an SAP HANA instance and install a Cloud Backup client on the instance, you can call this operation to query the information about SAP HANA databases. You can call the StartHanaDatabaseAsync operation to start a database and call the StopHanaDatabaseAsync operation to stop a database.
 *
 * @param request DescribeHanaDatabasesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHanaDatabasesResponse
 */
async function describeHanaDatabasesWithOptions(request: DescribeHanaDatabasesRequest, runtime: Util.RuntimeOptions): DescribeHanaDatabasesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHanaDatabases',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the information about SAP HANA databases.
 *
 * @description After you register an SAP HANA instance and install a Cloud Backup client on the instance, you can call this operation to query the information about SAP HANA databases. You can call the StartHanaDatabaseAsync operation to start a database and call the StopHanaDatabaseAsync operation to stop a database.
 *
 * @param request DescribeHanaDatabasesRequest
 * @return DescribeHanaDatabasesResponse
 */
async function describeHanaDatabases(request: DescribeHanaDatabasesRequest): DescribeHanaDatabasesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHanaDatabasesWithOptions(request, runtime);
}

model DescribeHanaInstancesRequest {
  clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance.', example='cl-0001zfc******50pr3'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 99. Default value: 10.', example='10'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-aekz24ikcjyqjkq'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key.', example='ace:rm:rgld'),
      value?: string(name='Value', description='The tag value.', example='rg-acfmwutpyat2kwy'),
    }
  ](name='Tag', description='The tags of the SAP HANA instance.'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-000b0ov******6zs'),
}

model DescribeHanaInstancesResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  hanas?: {
    hana?: [ 
    {
      alertSetting?: string(name='AlertSetting', description='The alert settings. Valid value: INHERITED, which indicates that the Cloud Backup client sends alert notifications by using the same method configured for the backup vault.', example='INHERITED'),
      clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance.', example='cl-0004cf6g6******0yd7y'),
      crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the Resource Access Management (RAM) role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='hbrcrossrole'),
      crossAccountType?: string(name='CrossAccountType', description='Specifies whether data is backed up within the same Alibaba Cloud account or across Alibaba Cloud accounts. Valid values:

*   **SELF_ACCOUNT**: Data is backed up within the same Alibaba Cloud account.
*   **CROSS_ACCOUNT**: Data is backed up across Alibaba Cloud accounts.', example='CROSS_ACCOUNT'),
      crossAccountUserId?: long(name='CrossAccountUserId', description='The ID of the source Alibaba Cloud account that authorizes the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='158975xxxxx4625'),
      hanaName?: string(name='HanaName', description='The name of the SAP HANA instance.', example='HANA-DEV'),
      host?: string(name='Host', description='The private or internal IP address of the host where the primary node of the SAP HANA instance resides.', example='47.100.XX.XX'),
      instanceNumber?: int32(name='InstanceNumber', description='The instance number of the SAP HANA system.', example='00'),
      resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmvnf22m7itha'),
      status?: long(name='Status', description='The status of the SAP HANA instance. Valid values:

*   INITIALIZING: The instance is being initialized.
*   INITIALIZED: The instance is registered.
*   INVALID_HANA_NODE: The instance is invalid.
*   INITIALIZE_FAILED: The client fails to be installed on the instance.', example='INITIALIZED'),
      statusMessage?: string(name='StatusMessage', description='The status information.', example='INSTALL_CLIENT_FAILED'),
      tags?: {
        tag?: [ 
        {
          key?: string(name='Key', description='The tag key.', example='ace:rm:rgld'),
          value?: string(name='Value', description='The tag value.', example='rg-acfmwutpyat2kwy'),
        }
      ](name='Tag')
      }(name='Tags', description='The tags of the SAP HANA instance.'),
      useSsl?: boolean(name='UseSsl', description='Indicates whether the SAP HANA instance is connected over Secure Sockets Layer (SSL). Valid values:

*   true: The SAP HANA instance is connected over SSL.
*   false: The SAP HANA instance is not connected over SSL.', example='true'),
      userName?: string(name='UserName', description='The username of the SYSTEMDB database.', example='admin'),
      validateCertificate?: boolean(name='ValidateCertificate', description='Indicates whether the SSL certificate of the SAP HANA instance is verified.', example='false'),
      vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-0000s974******1hl'),
    }
  ](name='Hana')
  }(name='Hanas', description='The information about the SAP HANA instances.'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 99. Default value: 10.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='4003DD68-3C3C-5071-B4FC-631A6C1BAC1C'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='21'),
}

model DescribeHanaInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHanaInstancesResponseBody(name='body'),
}

/**
 * @summary Queries one or more SAP HANA instances that meet the specified conditions.
 *
 * @param request DescribeHanaInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHanaInstancesResponse
 */
async function describeHanaInstancesWithOptions(request: DescribeHanaInstancesRequest, runtime: Util.RuntimeOptions): DescribeHanaInstancesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.tag)) {
    body['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHanaInstances',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries one or more SAP HANA instances that meet the specified conditions.
 *
 * @param request DescribeHanaInstancesRequest
 * @return DescribeHanaInstancesResponse
 */
async function describeHanaInstances(request: DescribeHanaInstancesRequest): DescribeHanaInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHanaInstancesWithOptions(request, runtime);
}

model DescribeHanaRestoresRequest {
  backupId?: long(name='BackupId', description='The backup ID.', example='1632754800158'),
  clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance.

This parameter is required.', example='cl-000b******soejg'),
  databaseName?: string(name='DatabaseName', description='The database name.', example='SYSTEMDB'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 99. Default value: 10.\\\\`', example='10'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfm4ebtpkzx7zy'),
  restoreId?: string(name='RestoreId', description='The ID of the restore job.', example='r-0007o3vqfukfe92hvf13'),
  restoreStatus?: string(name='RestoreStatus', description='The status of the restore job. Valid values:

*   **RUNNING**: The job is running.
*   **COMPLETE**: The job is completed.
*   **PARTIAL_COMPLETE**: The job is partially completed.
*   **FAILED**: The job failed.
*   **CANCELED**: The job is canceled.
*   **EXPIRED**: The job timed out.', example='COMPLETE'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-000au6bq******mpu'),
}

model DescribeHanaRestoresResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  hanaRestore?: {
    hanaRestores?: [ 
    {
      backupID?: long(name='BackupID', description='The backup ID.', example='1635315505'),
      backupPrefix?: string(name='BackupPrefix', description='The backup prefix.', example='INC_DATA_BACKUP'),
      checkAccess?: boolean(name='CheckAccess', description='Indicates whether the differential backup and log backup are validated. Valid values:

*   true: Cloud Backup checks whether the required differential backup and log backup are available before the restore job starts. If the differential backup or log backup is unavailable, Cloud Backup does not start the restore job.
*   false: Cloud Backup does not check whether the required differential backup and log backup are available before the restore job starts.', example='true'),
      clearLog?: boolean(name='ClearLog', description='Indicates whether all log entries are deleted from the log area after the log entries are restored. Valid values: true and false. If the return value is false, all log entries are deleted from the log area after the log entries are restored.', example='true'),
      clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance that is restored.', example='cl-000923yu******p00j4'),
      currentPhase?: int32(name='CurrentPhase', description='The current recovery phase. This value is obtained from SAP HANA.', example='2'),
      currentProgress?: long(name='CurrentProgress', description='The current progress. This value is obtained from SAP HANA.', example='1'),
      databaseName?: string(name='DatabaseName', description='The database name.', example='BWD'),
      databaseRestoreId?: long(name='DatabaseRestoreId', description='The ID of the database recovery.', example='1644038961030'),
      endTime?: long(name='EndTime', description='The time when the restore job ends. This value is a UNIX timestamp. Unit: seconds.', example='1634356382'),
      logPosition?: long(name='LogPosition', description='The log position to which the database is restored. This parameter is returned only if the value of the Mode parameter is **RECOVERY_TO_LOG_POSITION**.', example='0'),
      maxPhase?: int32(name='MaxPhase', description='The maximum recovery phase. This value is obtained from SAP HANA.', example='4'),
      maxProgress?: long(name='MaxProgress', description='The maximum progress. This value is obtained from SAP HANA.', example='1'),
      message?: string(name='Message', description='The details of the recovery phase.', example='SQL Error 448 - recovery could not be completed:'),
      mode?: string(name='Mode', description='The recovery mode. Valid values:

*   **RECOVERY_TO_MOST_RECENT**: The database is restored to the recently available state to which the database has been backed up.
*   **RECOVERY_TO_POINT_IN_TIME**: The database is restored to a specified point in time.
*   **RECOVERY_TO_SPECIFIC_BACKUP**: The database is restored to a specified backup.
*   **RECOVERY_TO_LOG_POSITION**: The database is restored to a specified log position.', example='RECOVERY_TO_SPECIFIC_BACKUP'),
      phase?: string(name='Phase', description='The recovery phase.', example='restart'),
      reachedTime?: long(name='ReachedTime', description='The point in time at which the database is restored.', example='1635315505'),
      recoveryPointInTime?: long(name='RecoveryPointInTime', description='The point in time to which the database is restored. This parameter is returned only if the value of the Mode parameter is **RECOVERY_TO_POINT_IN_TIME**. Cloud Backup restores the database to a state closest to the specified point in time.', example='1649851200'),
      restoreId?: string(name='RestoreId', description='The ID of the restore job.', example='r-000c1en183ayn9sesgqh'),
      source?: string(name='Source', description='The name of the source system. This parameter indicates the name of the source database that is restored. Format: `<Source database name>@SID`.', example='PRD@H4P'),
      sourceClusterId?: string(name='SourceClusterId', description='The ID of the source SAP HANA instance.', example='cl-0000g3mvy******5cj'),
      startTime?: long(name='StartTime', description='The time when the restore job starts. This value is a UNIX timestamp. Unit: seconds.', example='1636970413'),
      state?: string(name='State', description='The recovery status. This value is obtained from SAP HANA.', example='successful'),
      status?: string(name='Status', description='The status of the restore job. Valid values:

*   **RUNNING**: The job is running.
*   **COMPLETE**: The job is completed.
*   **PARTIAL_COMPLETE**: The job is partially completed.
*   **FAILED**: The job failed.
*   **CANCELED**: The job is canceled.
*   **EXPIRED**: The job timed out.', example='COMPLETE'),
      systemCopy?: boolean(name='SystemCopy', description='Indicates whether the database is restored to a different instance. Valid values:

*   true: The database is restored to a different instance.
*   false: The database is restored within the same instance.', example='true'),
      useCatalog?: boolean(name='UseCatalog', description='Indicates whether a catalog backup is used to restore the database. This parameter is returned only if the value of the Mode parameter is **RECOVERY_TO_SPECIFIC_BACKUP**. If the return value is false, Cloud Backup finds the backup file based on the specified prefix and then restores the backup file.', example='false'),
      useDelta?: boolean(name='UseDelta', description='Indicates whether a differential backup or an incremental backup is used to restore the database. Valid values: true and false. If the return value is true, Cloud Backup uses a differential backup or an incremental backup to restore the database. If the return value is false, Cloud Backup uses a log backup to restore the database.', example='true'),
      vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-000g9acf******gta'),
      volumeId?: int32(name='VolumeId', description='The ID of the volume that is restored. This parameter is returned only if the value of the Mode parameter is **RECOVERY_TO_LOG_POSITION**.', example='0'),
    }
  ](name='HanaRestores')
  }(name='HanaRestore', description='The information about restore jobs.'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 99. Default value: 10.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='7DEFC897-8F05-5C05-912C-C9A9510FBFF1'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='19'),
}

model DescribeHanaRestoresResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHanaRestoresResponseBody(name='body'),
}

/**
 * @summary Queries one or more SAP HANA restore jobs that meet the specified conditions.
 *
 * @param request DescribeHanaRestoresRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHanaRestoresResponse
 */
async function describeHanaRestoresWithOptions(request: DescribeHanaRestoresRequest, runtime: Util.RuntimeOptions): DescribeHanaRestoresResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.backupId)) {
    query['BackupId'] = request.backupId;
  }
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.databaseName)) {
    query['DatabaseName'] = request.databaseName;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.restoreId)) {
    query['RestoreId'] = request.restoreId;
  }
  if (!Util.isUnset(request.restoreStatus)) {
    query['RestoreStatus'] = request.restoreStatus;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHanaRestores',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries one or more SAP HANA restore jobs that meet the specified conditions.
 *
 * @param request DescribeHanaRestoresRequest
 * @return DescribeHanaRestoresResponse
 */
async function describeHanaRestores(request: DescribeHanaRestoresRequest): DescribeHanaRestoresResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHanaRestoresWithOptions(request, runtime);
}

model DescribeHanaRetentionSettingRequest {
  clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance.

This parameter is required.', example='cl-0002ys1i******wwtf'),
  databaseName?: string(name='DatabaseName', description='The database name.', example='C4P'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.

This parameter is required.', example='v-000ii8t******ntrt2'),
}

model DescribeHanaRetentionSettingResponseBody = {
  clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance.', example='cl-0003jyv******fsku5m'),
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  databaseName?: string(name='DatabaseName', description='The database name.', example='Q01'),
  disabled?: boolean(name='Disabled', description='Indicates whether the backup is permanently retained. Valid values:

*   true: The backup is permanently retained.
*   false: The backup is retained for the specified number of days.', example='false'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='280DD872-EE25-52E8-9CB4-491067173DD0'),
  retentionDays?: long(name='RetentionDays', description='The number of days for which the backup is retained. If the value of the Disabled parameter is false, the backup is retained for the number of days specified by this parameter.', example='3650'),
  schedule?: string(name='Schedule', description='The policy to update the retention period. Format: `I|{startTime}|{interval}`, which indicates that the retention period is updated at an interval of {interval} starting from {startTime}.

*   startTime: the time at which the system starts to run a backup job. The time follows the UNIX time format. Unit: seconds.
*   interval: the interval at which the system runs a backup job. The interval follows the ISO 8601 standard. For example, PT1H indicates an interval of 1 hour. P1D indicates an interval of one day.', example='I|0|P1D'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-0006wkn7******zkn'),
}

model DescribeHanaRetentionSettingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHanaRetentionSettingResponseBody(name='body'),
}

/**
 * @summary Queries the backup retention period of an SAP HANA database.
 *
 * @description *   If you want to query the backup parameters of a database, you can call the DescribeHanaBackupSetting operation.
 * *   Cloud Backup deletes the expired catalogs and data that are related to Backint and file backup. The deleted catalogs and data cannot be restored. We recommend that you set the retention period based on your business requirements.
 *
 * @param request DescribeHanaRetentionSettingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHanaRetentionSettingResponse
 */
async function describeHanaRetentionSettingWithOptions(request: DescribeHanaRetentionSettingRequest, runtime: Util.RuntimeOptions): DescribeHanaRetentionSettingResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.databaseName)) {
    query['DatabaseName'] = request.databaseName;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHanaRetentionSetting',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the backup retention period of an SAP HANA database.
 *
 * @description *   If you want to query the backup parameters of a database, you can call the DescribeHanaBackupSetting operation.
 * *   Cloud Backup deletes the expired catalogs and data that are related to Backint and file backup. The deleted catalogs and data cannot be restored. We recommend that you set the retention period based on your business requirements.
 *
 * @param request DescribeHanaRetentionSettingRequest
 * @return DescribeHanaRetentionSettingResponse
 */
async function describeHanaRetentionSetting(request: DescribeHanaRetentionSettingRequest): DescribeHanaRetentionSettingResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHanaRetentionSettingWithOptions(request, runtime);
}

model DescribeOtsTableSnapshotsRequest {
  crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the RAM role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='BackupRole'),
  crossAccountType?: string(name='CrossAccountType', description='Specifies whether data is backed up within the same Alibaba Cloud account or across Alibaba Cloud accounts. Valid values:

*   SELF_ACCOUNT: Data is backed up within the same Alibaba Cloud account.
*   CROSS_ACCOUNT: Data is backed up across Alibaba Cloud accounts.', example='CROSS_ACCOUNT'),
  crossAccountUserId?: long(name='CrossAccountUserId', description='The UID of the source account used for cross-account backup.', example='144015xxxxx98732'),
  endTime?: long(name='EndTime', description='The end time of the backup. The value must be a UNIX timestamp. Unit: milliseconds.', example='1652068250881'),
  limit?: int32(name='Limit', description='The maximum number of rows that you want the current query to return.', example='100'),
  nextToken?: string(name='NextToken', description='The token that is required to obtain the next page of backup snapshots.', example='caeba0bbb2be03f84eb48b699f0a****'),
  otsInstances?: [ 
    {
      instanceName?: string(name='InstanceName', description='The name of the Tablestore instance.', example='instancename'),
      tableNames?: [ string ](name='TableNames', description='The names of the tables in the Tablestore instance.'),
    }
  ](name='OtsInstances', description='The Tablestore instances that are backed up.'),
  snapshotIds?: [ string ](name='SnapshotIds', description='The snapshot IDs.'),
  startTime?: long(name='StartTime', description='The start time of the backup. The value must be a UNIX timestamp. Unit: milliseconds.', example='1611109271630'),
}

model DescribeOtsTableSnapshotsResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the request was successful.', example='200'),
  limit?: int32(name='Limit', description='The number of backup snapshots that are displayed on the current page.', example='10'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  nextToken?: string(name='NextToken', description='The token that is required to obtain the next page of backup snapshots.', example='caeba0bbb2be03f84eb48b699f0a'),
  requestId?: string(name='RequestId', description='The request ID.', example='09376812-6290-5E36-B504-E8010D72D1F0'),
  snapshots?: [ 
    {
      actualBytes?: string(name='ActualBytes', description='The actual data amount of backup snapshots after duplicates are removed. Unit: bytes.', example='0'),
      backupType?: string(name='BackupType', description='The backup type. Valid value: **COMPLETE**, which indicates full backup.', example='COMPLETE'),
      bytesTotal?: long(name='BytesTotal', description='The total amount of data. Unit: bytes.', example='0'),
      completeTime?: long(name='CompleteTime', description='The time when the backup snapshot was completed. The value is a UNIX timestamp. Unit: seconds.', example='1642496679'),
      createTime?: long(name='CreateTime', description='The time when the Tablestore instance was created. The value is a UNIX timestamp. Unit: seconds.', example='1607436917'),
      createdTime?: long(name='CreatedTime', description='The time when the backup snapshot was created. The value is a UNIX timestamp. Unit: seconds.', example='1642496679'),
      instanceName?: string(name='InstanceName', description='The name of the Tablestore instance.', example='instancename'),
      jobId?: string(name='JobId', description='The ID of the backup job.', example='job-00030j3chkt******2'),
      parentSnapshotHash?: string(name='ParentSnapshotHash', description='The hash value of the parent backup snapshot.', example='f2fe..'),
      rangeEnd?: long(name='RangeEnd', description='The time when the backup job ended. The value is a UNIX timestamp. Unit: milliseconds.', example='1642521709966'),
      rangeStart?: long(name='RangeStart', description='The time when the backup job started. The value is a UNIX timestamp. Unit: milliseconds.', example='1642492553038'),
      retention?: long(name='Retention', description='The retention period of the backup snapshot. Unit: days.', example='730'),
      snapshotHash?: string(name='SnapshotHash', description='The hash value of the backup snapshot.', example='f2fe...'),
      snapshotId?: string(name='SnapshotId', description='The ID of the backup snapshot.', example='s-00047mxg17p26*****b'),
      sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **ECS_FILE**: backup snapshots for Elastic Compute Service (ECS) files
*   **OSS**: backup snapshots for Object Storage Service (OSS) buckets
*   **NAS**: backup snapshots for Apsara File Storage NAS file systems
*   **OTS_TABLE**: backup snapshots for Tablestore instances', example='OTS_TABLE'),
      startTime?: long(name='StartTime', description='The time when the backup snapshot started. The value is a UNIX timestamp. Unit: seconds.', example='1642496543'),
      status?: string(name='Status', description='The status of the backup job. Valid values:

*   **COMPLETE**: The backup job is completed.
*   **PARTIAL_COMPLETE**: The backup job is partially completed.
*   **FAILED**: The backup job has failed.', example='COMPLETE'),
      tableName?: string(name='TableName', description='The name of the table in the Tablestore instance.', example='table2'),
      updatedTime?: long(name='UpdatedTime', description='The time when the backup snapshot was updated. The value is a UNIX timestamp. Unit: seconds.', example='1642496679'),
      vaultId?: string(name='VaultId', description='The ID of the backup vault that stores the backup snapshot.', example='v-00030j*******sn'),
    }
  ](name='Snapshots', description='The backup snapshots.'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DescribeOtsTableSnapshotsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeOtsTableSnapshotsResponseBody(name='body'),
}

/**
 * @summary Queries the details about Tablestore instances that are backed up.
 *
 * @param request DescribeOtsTableSnapshotsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeOtsTableSnapshotsResponse
 */
async function describeOtsTableSnapshotsWithOptions(request: DescribeOtsTableSnapshotsRequest, runtime: Util.RuntimeOptions): DescribeOtsTableSnapshotsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.crossAccountRoleName)) {
    query['CrossAccountRoleName'] = request.crossAccountRoleName;
  }
  if (!Util.isUnset(request.crossAccountType)) {
    query['CrossAccountType'] = request.crossAccountType;
  }
  if (!Util.isUnset(request.crossAccountUserId)) {
    query['CrossAccountUserId'] = request.crossAccountUserId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.limit)) {
    body['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.otsInstances)) {
    bodyFlat['OtsInstances'] = request.otsInstances;
  }
  if (!Util.isUnset(request.snapshotIds)) {
    bodyFlat['SnapshotIds'] = request.snapshotIds;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeOtsTableSnapshots',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the details about Tablestore instances that are backed up.
 *
 * @param request DescribeOtsTableSnapshotsRequest
 * @return DescribeOtsTableSnapshotsResponse
 */
async function describeOtsTableSnapshots(request: DescribeOtsTableSnapshotsRequest): DescribeOtsTableSnapshotsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeOtsTableSnapshotsWithOptions(request, runtime);
}

model DescribePoliciesV2Request {
  maxResults?: int32(name='MaxResults', description='The number of results for each query.

Valid values: 10 to 100. Default value: 10.', example='10'),
  nextToken?: string(name='NextToken', description='The token that is used to obtain the next page of backup policies.', example='caeba0bbb2be03f84eb48b699f0a'),
  policyId?: string(name='PolicyId', description='The ID of the backup policy.', example='po-000************2l6'),
}

model DescribePoliciesV2ResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  maxResults?: int32(name='MaxResults', description='The number of results for each query.

Valid values: 10 to 100. Default value: 10.', example='10'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  nextToken?: string(name='NextToken', description='The token that is used to obtain the next page of backup policies.', example='caeba0bbb2be03f84eb48b699f0a'),
  policies?: [ 
    {
      createdTime?: long(name='CreatedTime', description='The time when the backup policy was created. The value is a UNIX timestamp. Unit: seconds.', example='1650248136'),
      policyBindingCount?: long(name='PolicyBindingCount', description='The number of data sources that are bound to the backup policy.', example='5'),
      policyDescription?: string(name='PolicyDescription', description='The description of the backup policy.', example='Data is backed up at 10:00:00 every day and replicated to the China (Shanghai) region for geo-redundancy.'),
      policyId?: string(name='PolicyId', description='The ID of the backup policy.', example='po-000************bkz'),
      policyName?: string(name='PolicyName', description='The name of the backup policy.', example='Daily Local Backup + Remote Backup'),
      policyType?: string(name='PolicyType', description='The policy type. Valid values:

*   **STANDARD**: the general backup policy. This type of policy applies to backups other than Elastic Compute Service (ECS) instance backup.
*   **UDM_ECS_ONLY**: the ECS instance backup policy. This type of policy applies only to ECS instance backup.', example='STANDARD'),
      rules?: [ 
        {
          archiveDays?: long(name='ArchiveDays', description='This parameter is returned only if the value of the **RuleType** parameter is **TRANSITION**. This parameter indicates the time when data is dumped from a backup vault to an archive vault. Unit: days.', example='30'),
          backupType?: string(name='BackupType', description='This parameter is returned only if the value of the **RuleType** parameter is **BACKUP**. This parameter indicates the backup type. Valid value: **COMPLETE**, which indicates full backup.', example='COMPLETE'),
          dataSourceFilters?: [ 
            {
              dataSourceIds?: [ string ](name='DataSourceIds', description='Deprecated.'),
              sourceType?: string(name='SourceType', description='Data source type. The value range is as follows: 
- **UDM_ECS**: Indicates ECS server backup. 
- **OSS**: Indicates OSS backup. 
- **NAS**: Indicates Alibaba Cloud NAS backup. 
- **ECS_FILE**: Indicates ECS file backup. 
- **OTS**: Indicates Tablestore backup.', example='UDM_ECS'),
            }
          ](name='DataSourceFilters', description='This parameter is required only when **RuleType** is set to **TAG**. It defines the data source filtering rule.'),
          immutable?: boolean(name='Immutable', description='This parameter is returned only if the **PolicyType** is **UDM_ECS_ONLY**. This parameter indicates whether the immutable backup feature is enabled.', example='true'),
          keepLatestSnapshots?: long(name='KeepLatestSnapshots', description='Indicates whether the feature of keeping at least one backup version is enabled. Valid values:

*   **0**: The feature is disabled.
*   **1**: The feature is enabled.', example='1'),
          replicationRegionId?: string(name='ReplicationRegionId', description='This parameter is returned only if the value of the **RuleType** parameter is **REPLICATION**. This parameter indicates the ID of the destination region.', example='cn-shanghai'),
          retention?: long(name='Retention', description='This parameter is returned only if the value of the **RuleType** parameter is **TRANSITION** or **REPLICATION**.

*   If the value of the **RuleType** parameter is **TRANSITION**, this parameter indicates the retention period of the backup data. Minimum value: 1. Unit: days.
*   If the value of the **RuleType** parameter is **REPLICATION**, this parameter indicates the retention period of remote backups. Minimum value: 1. Unit: days.', example='7'),
          retentionRules?: [ 
            {
              advancedRetentionType?: string(name='AdvancedRetentionType', description='The type of the special retention rule. Valid values:

*   **WEEKLY**: weekly backups
*   **MONTHLY**: monthly backups
*   **YEARLY**: yearly backups', example='YEARLY'),
              retention?: long(name='Retention', description='The special retention period of backups. Minimum value: 1. Unit: days.', example='730'),
              whichSnapshot?: long(name='WhichSnapshot', description='Indicates which backup is retained based on the special retention rule. Only the first backup can be retained.', example='1'),
            }
          ](name='RetentionRules', description='This parameter is returned only if the value of the **RuleType** parameter is **TRANSITION**. This parameter indicates the special retention rules.'),
          ruleId?: string(name='RuleId', description='The rule ID.', example='rule-000************f1e'),
          ruleType?: string(name='RuleType', description='The type of the rule. Each backup policy must have at least one rule of the **BACKUP** type and only one rule of the **TRANSITION** type. Valid values:

*   **BACKUP**: backup rule
*   **TRANSITION**: lifecycle rule
*   **REPLICATION**: replication rule', example='BACKUP'),
          schedule?: string(name='Schedule', description='This parameter is returned only if the value of the **RuleType** parameter is **BACKUP**. This parameter indicates the backup schedule settings. Format: `I|{startTime}|{interval}`. The system runs the first backup job at a point in time that is specified in the {startTime} parameter and the subsequent backup jobs at an interval that is specified in the {interval} parameter. The system does not run a backup job before the specified point in time. Each backup job, except the first one, starts only after the previous backup job is completed. For example, `I|1631685600|P1D` indicates that the system runs the first backup job at 14:00:00 on September 15, 2021 and the subsequent backup jobs once a day.

*   startTime: the time at which the system starts to run a backup job. The time follows the UNIX time format. Unit: seconds.
*   interval: the interval at which the system runs a backup job. The interval follows the ISO 8601 standard. For example, PT1H indicates an interval of 1 hour. P1D indicates an interval of one day.', example='I|1648647166|P1D'),
          tagFilters?: [ 
            {
              key?: string(name='Key', description='Tag key', example='env'),
              operator?: string(name='Operator', description='Tag matching rules, supporting: - **EQUAL**: Matches both the tag key and tag value. - **NOT**: Matches the tag key but not the tag value.', example='EQUAL'),
              value?: string(name='Value', description='Tag value.', example='prod'),
            }
          ](name='TagFilters', description='This parameter is required only when **RuleType** is set to **TAG**. It defines the resource tag filtering rule.'),
          vaultId?: string(name='VaultId', description='This parameter is returned only if the value of the RuleType parameter is BACKUP. The ID of the backup vault.', example='v-000**************kgm'),
        }
      ](name='Rules', description='The rules in the backup policy.'),
      updatedTime?: long(name='UpdatedTime', description='The time when the backup policy was updated. The value is a UNIX timestamp. Unit: seconds.', example='1662080404'),
    }
  ](name='Policies', description='The backup policies.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
  totalCount?: long(name='TotalCount', description='The total number of returned entries.', example='12'),
}

model DescribePoliciesV2Response = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePoliciesV2ResponseBody(name='body'),
}

/**
 * @summary Queries one or more backup policies.
 *
 * @param request DescribePoliciesV2Request
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePoliciesV2Response
 */
async function describePoliciesV2WithOptions(request: DescribePoliciesV2Request, runtime: Util.RuntimeOptions): DescribePoliciesV2Response {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.maxResults)) {
    body['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.policyId)) {
    body['PolicyId'] = request.policyId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribePoliciesV2',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries one or more backup policies.
 *
 * @param request DescribePoliciesV2Request
 * @return DescribePoliciesV2Response
 */
async function describePoliciesV2(request: DescribePoliciesV2Request): DescribePoliciesV2Response {
  var runtime = new Util.RuntimeOptions{};
  return describePoliciesV2WithOptions(request, runtime);
}

model DescribePolicyBindingsRequest {
  dataSourceIds?: [ string ](name='DataSourceIds', description='List of data source IDs.'),
  filters?: [ 
    {
      key?: string(name='Key', description='Key in the query filter. Possible values include:

- **PolicyId**: Backup policy ID
- **DataSourceId**: ECS instance ID
- **DataSourceType**: Data source type', example='DataSourceType'),
      operator?: string(name='Operator', description='Matching method. Default is IN. This refers to the matching operation (Operator) supported by the Key and Value in the filter. Possible values include:

- **EQUAL**: Equal to
- **NOT_EQUAL**: Not equal to
- **GREATER_THAN**: Greater than
- **GREATER_THAN_OR_EQUAL**: Greater than or equal to
- **LESS_THAN**: Less than
- **LESS_THAN_OR_EQUAL**: Less than or equal to
- **BETWEEN**: Range, where value is a JSON array `[lower_bound, upper_bound]`.
- **IN**: In the set, where value is an array.', example='IN'),
      values?: [ string ](name='Values', description='Values to be matched in the query filter.'),
    }
  ](name='Filters', description='Query filters.'),
  maxResults?: int32(name='MaxResults', description='Number of results per query.

Range: 10~100. Default: 10.', example='10'),
  nextToken?: string(name='NextToken', description='Token required to fetch the next page of policy and data source associations.', example='caeba0bbb2be03f84eb48b699f0a'),
  policyId?: string(name='PolicyId', description='Policy ID.', example='po-000************hky'),
  sourceType?: string(name='SourceType', description='Data source type. Possible values:
* **UDM_ECS**: Indicates ECS full machine backup.', example='UDM_ECS'),
}

model DescribePolicyBindingsShrinkRequest {
  dataSourceIdsShrink?: string(name='DataSourceIds', description='List of data source IDs.'),
  filters?: [ 
    {
      key?: string(name='Key', description='Key in the query filter. Possible values include:

- **PolicyId**: Backup policy ID
- **DataSourceId**: ECS instance ID
- **DataSourceType**: Data source type', example='DataSourceType'),
      operator?: string(name='Operator', description='Matching method. Default is IN. This refers to the matching operation (Operator) supported by the Key and Value in the filter. Possible values include:

- **EQUAL**: Equal to
- **NOT_EQUAL**: Not equal to
- **GREATER_THAN**: Greater than
- **GREATER_THAN_OR_EQUAL**: Greater than or equal to
- **LESS_THAN**: Less than
- **LESS_THAN_OR_EQUAL**: Less than or equal to
- **BETWEEN**: Range, where value is a JSON array `[lower_bound, upper_bound]`.
- **IN**: In the set, where value is an array.', example='IN'),
      values?: [ string ](name='Values', description='Values to be matched in the query filter.'),
    }
  ](name='Filters', description='Query filters.'),
  maxResults?: int32(name='MaxResults', description='Number of results per query.

Range: 10~100. Default: 10.', example='10'),
  nextToken?: string(name='NextToken', description='Token required to fetch the next page of policy and data source associations.', example='caeba0bbb2be03f84eb48b699f0a'),
  policyId?: string(name='PolicyId', description='Policy ID.', example='po-000************hky'),
  sourceType?: string(name='SourceType', description='Data source type. Possible values:
* **UDM_ECS**: Indicates ECS full machine backup.', example='UDM_ECS'),
}

model DescribePolicyBindingsResponseBody = {
  code?: string(name='Code', description='Return code, 200 indicates success.', example='200'),
  maxResults?: int32(name='MaxResults', description='The number of results per query.

Range: 10~100. Default: 10.', example='10'),
  message?: string(name='Message', description='Description of the return message. A successful response usually returns \\\\"successful\\\\", while an error will return a corresponding error message.', example='successful'),
  nextToken?: string(name='NextToken', description='The token required to fetch the next page of policy and data source bindings.', example='caeba0bbb2be03f84eb48b699f0a'),
  policyBindings?: [ 
    {
      advancedOptions?: {
        commonFileSystemDetail?: {
          fetchSliceSize?: long(name='FetchSliceSize', description='Backup shard size (number of files).', example='100000'),
          fullOnIncrementFail?: boolean(name='FullOnIncrementFail', description='Whether to switch to a full backup when an incremental backup fails. Values:
- **true**: Switch to full backup on failure.
- **false**: Do not switch to full backup on failure.', example='true'),
        }(name='CommonFileSystemDetail', description='Advanced options for large-scale file system backup.'),
        commonNasDetail?: {
          clientId?: string(name='ClientId', description='Backup client ID.', example='c-0001eg6mcvjs93f46s2d'),
          clusterId?: string(name='ClusterId', description='Client group ID.', example='cl-000gkcofngi04j6k680a'),
          fetchSliceSize?: long(name='FetchSliceSize', description='Backup slice size (number of files).', example='100000'),
          fullOnIncrementFail?: boolean(name='FullOnIncrementFail', description='Whether to switch to a full backup when an incremental backup fails. Values:
- **true**: Switch to full backup on failure.
- **false**: Do not switch to full backup on failure.', example='true'),
        }(name='CommonNasDetail', description='Advanced options for local NAS.'),
        fileDetail?: {
          advPolicy?: boolean(name='AdvPolicy', description='Whether to use advanced policies. Values:
- **true**: Use.
- **false**: Do not use.', example='false'),
          useVSS?: boolean(name='UseVSS', description='Whether to enable VSS (Windows) functionality. Values:
- **true**: Enable.
- **false**: Disable.', example='false'),
        }(name='FileDetail', description='Advanced options for file backup.'),
        ossDetail?: {
          ignoreArchiveObject?: boolean(name='IgnoreArchiveObject', description='Do not prompt for archive-type objects in the task statistics and failed file list.', example='true'),
          inventoryCleanupPolicy?: string(name='InventoryCleanupPolicy', description='Whether to delete the inventory file after the backup. This is only effective when using an OSS inventory. Supported values:
- **NO_CLEANUP**: Do not delete.
- **DELETE_CURRENT**: Delete the current file.
- **DELETE_CURRENT_AND_PREVIOUS**: Delete all files.', example='DELETE_CURRENT_AND_PREVIOUS'),
          inventoryId?: string(name='InventoryId', description='The name of the OSS inventory. If this value is not empty, the OSS inventory will be used for performance optimization.
- It is recommended to use an inventory for backing up more than 100 million OSS objects to improve incremental performance. Storage costs for the inventory files are charged separately by the OSS service.
- The generation of the OSS inventory file takes time, and the backup may fail before the inventory file is generated. You can wait for the next cycle to execute.', example='inventory_test'),
        }(name='OssDetail', description='Advanced options for OSS backup.'),
        udmDetail?: {
          appConsistent?: boolean(name='AppConsistent', description='是否创建应用一致性。仅云盘类型全部为ESSD时，支持创建快照应用一致性。', example='false'),
          destinationKmsKeyId?: string(name='DestinationKmsKeyId', description='The custom KMS key ID in the destination region. When this field is not empty and cross-region replication is enabled, the specified key will be used for encrypting the cross-region replication.', example='4ed37b1e-da51-4187-aceb-9db4f9b7148b'),
          diskIdList?: [ string ](name='DiskIdList', description='List of disk IDs that need protection. This value is empty when protecting all disks.'),
          enableFsFreeze?: boolean(name='EnableFsFreeze', description='This parameter is required when **AppConsistent** is **true**. It indicates whether to use the Linux FsFreeze mechanism to ensure the file system is in a read-only consistent state before creating an application-consistent snapshot. The default value is true.', example='true'),
          enableWriters?: boolean(name='EnableWriters', description='This parameter is required when **AppConsistent** is **true**. It determines whether to set an application-consistent snapshot:
- **true**: Create an application-consistent snapshot
- **false**: Create a file system-consistent snapshot

The default value is true.', example='true'),
          excludeDiskIdList?: [ string ](name='ExcludeDiskIdList', description='List of disk IDs that do not need protection. This parameter is ignored if DiskIdList is not empty.'),
          postScriptPath?: string(name='PostScriptPath', description='This parameter is required when **AppConsistent** is **true**. It specifies the path of the unfreeze script to be executed after creating an application-consistent snapshot.', example='/tmp/postscript.sh'),
          preScriptPath?: string(name='PreScriptPath', description='This parameter is required when **AppConsistent** is **true**. It specifies the path of the freeze script to be executed before creating an application-consistent snapshot.', example='/tmp/prescript.sh'),
          ramRoleName?: string(name='RamRoleName', description='This parameter is required when **AppConsistent** is **true**. It specifies the RAM role name needed for creating an application-consistent snapshot.', example='AliyunECSInstanceForHbrRole'),
          snapshotGroup?: boolean(name='SnapshotGroup', description='Indicates whether to create a snapshot consistency group. Only supported when all disk types are ESSD.', example='true'),
          timeoutInSeconds?: long(name='TimeoutInSeconds', description='This parameter is required when **AppConsistent** is **true**. It specifies the IO freeze timeout duration. The default value is 30 seconds.', example='30'),
        }(name='UdmDetail', description='Advanced options for full machine backup.'),
      }(name='AdvancedOptions', description='Advanced options.'),
      createdByTag?: boolean(name='CreatedByTag', description='Whether the resource is automatically associated through the backup policy resource tag.', example='false'),
      createdTime?: long(name='CreatedTime', description='Creation time. UNIX timestamp, in seconds.', example='1661399570'),
      crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the role created in the RAM of the original account for cross-account backup.', example='hbrcrossrole'),
      crossAccountType?: string(name='CrossAccountType', description='Cross-account backup type. Supported values: 
- SELF_ACCOUNT: Backup within the same account
- CROSS_ACCOUNT: Cross-account backup', example='CROSS_ACCOUNT'),
      crossAccountUserId?: long(name='CrossAccountUserId', description='The ID of the original account for cross-account backup.', example='1480************'),
      dataSourceId?: string(name='DataSourceId', description='Data source ID.', example='i-8vb************5ly'),
      disabled?: boolean(name='Disabled', description='Whether the policy is disbaled for this data source.
- true: disabled
- false: Not disabled', example='true'),
      exclude?: string(name='Exclude', description='This parameter is required only when **SourceType** is **ECS_FILE** or **File**. It specifies the file types that should not be backed up, and all files of these types will be excluded. Supports up to 255 characters.', example='[\\\\"*.doc\\\\",\\\\"*.xltm\\\\"]'),
      hitTags?: [ 
        {
          key?: string(name='Key', description='Tag key.', example='env'),
          operator?: string(name='Operator', description='Tag matching rule.
- **EQUAL**: Matches both the tag key and tag value.
- **NOT**: Matches the tag key but not the tag value.', example='EQUAL'),
          value?: string(name='Value', description='Tag value.', example='prod'),
        }
      ](name='HitTags', description='Hit tag rules.'),
      include?: string(name='Include', description='This parameter is required only when **SourceType** is **ECS_FILE** or **File**. It specifies the file types to be backed up, and all files of these types will be backed up. Supports up to 255 characters.', example='[\\\\"*.doc\\\\",\\\\"*.xltm\\\\"]'),
      policyBindingDescription?: string(name='PolicyBindingDescription', description='Bound policy description.', example='po-000************eslc-i-uf6************y5g'),
      policyBindingId?: string(name='PolicyBindingId', description='Bound policy ID.', example='pd-000************slc'),
      policyId?: string(name='PolicyId', description='Policy ID.', example='po-000************56y'),
      source?: string(name='Source', description='- When **SourceType** is **OSS**, it indicates the prefix to be backed up. If not specified, it means backing up the entire root directory of the Bucket.
- When **SourceType** is **ECS_FILE** or **File**, it indicates the file directory to be backed up. If not specified, it means backing up all directories.', example='backup/'),
      sourceType?: string(name='SourceType', description='Data source type, with the value range:
- **UDM_ECS**: indicates ECS full machine backup', example='UDM_ECS'),
      speedLimit?: string(name='SpeedLimit', description='This parameter is required only when **SourceType** is **ECS_FILE** or **File**. It specifies the backup traffic control. The format is `{start}{end}{bandwidth}`. Multiple traffic control configurations are separated by commas, and the configured times must not overlap.

- **start**: Start hour.
- **end**: End hour.
- **bandwidth**: Limit rate, in KB/s.', example='0:24:10240'),
      updatedTime?: long(name='UpdatedTime', description='Update time. UNIX timestamp, in seconds.', example='1653611573'),
    }
  ](name='PolicyBindings', description='List of bound policies.'),
  requestId?: string(name='RequestId', description='Request ID.', example='5225929A-4EBD-55EE-9FE1-4A130E582A76'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.

- true: Success
- false: Failure', example='true'),
  totalCount?: long(name='TotalCount', description='Total number of records.', example='38'),
}

model DescribePolicyBindingsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePolicyBindingsResponseBody(name='body'),
}

/**
 * @summary Query one or more data sources bound to a policy, or query one or more policies bound to a data source.
 *
 * @param tmpReq DescribePolicyBindingsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePolicyBindingsResponse
 */
async function describePolicyBindingsWithOptions(tmpReq: DescribePolicyBindingsRequest, runtime: Util.RuntimeOptions): DescribePolicyBindingsResponse {
  Util.validateModel(tmpReq);
  var request = new DescribePolicyBindingsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.dataSourceIds)) {
    request.dataSourceIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.dataSourceIds, 'DataSourceIds', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.filters)) {
    query['Filters'] = request.filters;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.dataSourceIdsShrink)) {
    body['DataSourceIds'] = request.dataSourceIdsShrink;
  }
  if (!Util.isUnset(request.maxResults)) {
    body['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.policyId)) {
    body['PolicyId'] = request.policyId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribePolicyBindings',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Query one or more data sources bound to a policy, or query one or more policies bound to a data source.
 *
 * @param request DescribePolicyBindingsRequest
 * @return DescribePolicyBindingsResponse
 */
async function describePolicyBindings(request: DescribePolicyBindingsRequest): DescribePolicyBindingsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePolicyBindingsWithOptions(request, runtime);
}

model DescribeRecoverableOtsInstancesRequest {
  crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the Resource Access Management (RAM) role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='hbrcrossrole'),
  crossAccountType?: string(name='CrossAccountType', description='Specifies whether data is backed up within the same Alibaba Cloud account or across Alibaba Cloud accounts. Valid values:

*   SELF_ACCOUNT: Data is backed up within the same Alibaba Cloud account.
*   CROSS_ACCOUNT: Data is backed up across Alibaba Cloud accounts.', example='CROSS_ACCOUNT'),
  crossAccountUserId?: long(name='CrossAccountUserId', description='The ID of the source Alibaba Cloud account that authorizes the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='1440155109798732'),
}

model DescribeRecoverableOtsInstancesResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  otsInstances?: [ 
    {
      instanceName?: string(name='InstanceName', description='The name of the Tablestore instance that can be restored.', example='instancename'),
      tableNames?: [ string ](name='TableNames', description='The names of the tables in the Tablestore instance.'),
    }
  ](name='OtsInstances', description='The list of Tablestore instances that can be restored and the tables in the instances.'),
  requestId?: string(name='RequestId', description='The request ID.', example='14DC089E-5DD3-5028-AEDB-93D78E11DB2A'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DescribeRecoverableOtsInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRecoverableOtsInstancesResponseBody(name='body'),
}

/**
 * @summary Queries the tables of a restorable Tablestore instance.
 *
 * @param request DescribeRecoverableOtsInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRecoverableOtsInstancesResponse
 */
async function describeRecoverableOtsInstancesWithOptions(request: DescribeRecoverableOtsInstancesRequest, runtime: Util.RuntimeOptions): DescribeRecoverableOtsInstancesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.crossAccountRoleName)) {
    query['CrossAccountRoleName'] = request.crossAccountRoleName;
  }
  if (!Util.isUnset(request.crossAccountType)) {
    query['CrossAccountType'] = request.crossAccountType;
  }
  if (!Util.isUnset(request.crossAccountUserId)) {
    query['CrossAccountUserId'] = request.crossAccountUserId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRecoverableOtsInstances',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the tables of a restorable Tablestore instance.
 *
 * @param request DescribeRecoverableOtsInstancesRequest
 * @return DescribeRecoverableOtsInstancesResponse
 */
async function describeRecoverableOtsInstances(request: DescribeRecoverableOtsInstancesRequest): DescribeRecoverableOtsInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRecoverableOtsInstancesWithOptions(request, runtime);
}

model DescribeRegionsResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  regions?: {
    region?: [ 
    {
      localName?: string(name='LocalName', description='The region name.', example='China (Hangzhou)'),
      regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
    }
  ](name='Region')
  }(name='Regions', description='The regions returned.'),
  requestId?: string(name='RequestId', description='The request ID.', example='B3395EC6-7A4A-5282-A9AB-7A442F2CFC90'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DescribeRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRegionsResponseBody(name='body'),
}

/**
 * @summary Queries available regions.
 *
 * @param request DescribeRegionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRegionsResponse
 */
async function describeRegionsWithOptions(runtime: Util.RuntimeOptions): DescribeRegionsResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'DescribeRegions',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries available regions.
 *
 * @return DescribeRegionsResponse
 */
async function describeRegions(): DescribeRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRegionsWithOptions(runtime);
}

model DescribeRestoreJobs2Request {
  filters?: [ 
    {
      key?: string(name='Key', description='The key in the filter. Valid values:

*   **RegionId**: the region ID
*   **PlanId**: the ID of a backup plan
*   **JobId**: the ID of a backup job
*   **VaultId**: the ID of a backup vault
*   **InstanceId**: the ID of an ECS instance
*   **Bucket**: the name of an OSS bucket
*   **FileSystemId**: the ID of a file system
*   **Status**: the status of a backup job
*   **CompleteTime**: the end time of a backup job', example='VaultId'),
      operator?: string(name='Operator', description='The matching method. Default value: IN. This parameter specifies the operator that you want to use to match a key and a value in the filter. Valid values:

*   **EQUAL**: equal to
*   **NOT_EQUAL**: not equal to
*   **GREATER_THAN**: greater than
*   **GREATER_THAN_OR_EQUAL**: greater than or equal to
*   **LESS_THAN**: less than
*   **LESS_THAN_OR_EQUAL**: less than or equal to
*   **BETWEEN**: specifies a JSON array as a range. The results must fall within the range in the `[Minimum value,Maximum value]` format.
*   **IN**: specifies an array as a collection. The results must fall within the collection.

> If you specify the **CompleteTime** parameter as a key to query backup jobs, you cannot use the IN operator to perform a match.', example='IN'),
      values?: [ string ](name='Values', description='The values that you want to match in the filter.'),
    }
  ](name='Filters', description='The keys in the filter.'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 99. Default value: 10.', example='10'),
  restoreType?: string(name='RestoreType', description='The type of the data source. Valid values:

*   **ECS_FILE**: Elastic Compute Service (ECS) files
*   **OSS**: Object Storage Service (OSS) buckets
*   **NAS**: Apsara File Storage NAS file systems
*   **OTS_TABLE**: Tablestore instances
*   **UDM_ECS_ROLLBACK**: ECS instances', example='ECS_FILE'),
}

model DescribeRestoreJobs2ResponseBody = {
  code?: string(name='Code', description='The response status code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The response message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 99. Default value: 10.', example='1'),
  requestId?: string(name='RequestId', description='The request ID.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  restoreJobs?: {
    restoreJob?: [ 
    {
      actualBytes?: long(name='ActualBytes', description='The actual amount of data that is restored after duplicates are removed. Unit: bytes.', example='600'),
      actualItems?: long(name='ActualItems', description='This parameter is valid only if the **SourceType** parameter is set to **ECS_FILE**. This parameter indicates the actual number of objects that are restored by the restore job.', example='6'),
      bytesDone?: long(name='BytesDone', description='The amount of data that was restored. Unit: bytes.', example='800'),
      bytesTotal?: long(name='BytesTotal', description='The total amount of data that was backed up from the data source. Unit: bytes.', example='1000'),
      clusterId?: string(name='ClusterId', description='The ID of the client group used for restoration.', example='cl-000******hp6'),
      completeTime?: long(name='CompleteTime', description='The time when the restore job was completed. This value is a UNIX timestamp. Unit: seconds.', example='1554347313'),
      createdTime?: long(name='CreatedTime', description='The time when the restore job was created. This value is a UNIX timestamp. Unit: seconds.', example='1554347313'),
      crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the Resource Access Management (RAM) role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='BackupRole'),
      crossAccountType?: string(name='CrossAccountType', description='Indicates whether data is backed up within the same Alibaba Cloud account or across Alibaba Cloud accounts. Valid values:

*   SELF_ACCOUNT: Data is backed up within the same Alibaba Cloud account.
*   CROSS_ACCOUNT: Data is backed up across Alibaba Cloud accounts.', example='SELF_ACCOUNT'),
      crossAccountUserId?: long(name='CrossAccountUserId', description='The ID of the source Alibaba Cloud account that authorizes the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='158975xxxxxx4625'),
      errorFile?: string(name='ErrorFile', description='The files that failed to be restored.', example='"test.csv"'),
      errorMessage?: string(name='ErrorMessage', description='The error message that is returned for the restore job.', example='PARTIAL_COMPLETE'),
      exclude?: string(name='Exclude', description='This parameter is valid only if the **SourceType** parameter is set to **ECS_FILE**. This parameter indicates the paths to the files that are excluded from the restore job. The value can be up to 255 characters in length.', example='["/var", "/proc"]'),
      expireTime?: long(name='ExpireTime', description='The time when the restore job expires.', example='1634714531'),
      failbackDetail?: string(name='FailbackDetail', description='The details about the VMware failback task.', example='{"cpu":4,"extra":"{\\\\"restoreVMNamePrefix\\\\":\\\\"627-\\\\",\\\\"dataCenterName\\\\":\\\\"SDDC-Datacenter\\\\",\\\\"dataStoreId\\\\":\\\\"datastore-50\\\\",\\\\"folderId\\\\":\\\\"group-v49\\\\",\\\\"resourcePoolId\\\\":\\\\"resgroup-46\\\\",\\\\"locationName\\\\":\\\\"vcenter.pc-uf600arcwi9td3eyj641.acvs.aliyuncs.com/SDDC-Datacenter/Workloads\\\\",\\\\"computeResourceName\\\\":\\\\"SDDC-Datacenter/Default_c-uf600arcwi9td3eyj640\\\\",\\\\"dataStoreName\\\\":\\\\"Default_c-uf600arcwi9td3eyj640/WorkloadDatastore\\\\",\\\\"networkMoReference\\\\":\\\\"DistributedVirtualPortgroup:dvportgroup-1001\\\\",\\\\"useHotAdd\\\\":false}","instanceId":"i-2vc357i2eannmmotcagz","memoryInMB":8192,"serverId":"0fdc0c86-eb92-4e05-91ab-eeaf9fb6ad01","uefiBoot":false}'),
      include?: string(name='Include', description='The paths to the files that are included in the restore job.', example='["/home/alice/*.pdf", "/home/bob/*.txt"]'),
      itemsDone?: long(name='ItemsDone', description='This parameter is valid only if the **SourceType** parameter is set to **ECS_FILE**. This parameter indicates the number of restored objects.', example='8'),
      itemsTotal?: long(name='ItemsTotal', description='This parameter is valid only if the **SourceType** parameter is set to **ECS_FILE**. This parameter indicates the total number of objects in the data source.', example='10'),
      meteringBytesDone?: long(name='MeteringBytesDone', description='The amount of data that was restored. Unit: bytes. This parameter is valid only if the StorageClass parameter is set to ARCHIVE. The minimum billable size of the data stored at the Archive tier is 1 MB.', example='1048576'),
      meteringBytesTotal?: long(name='MeteringBytesTotal', description='The total amount of data that was backed up from the data source. Unit: bytes. This parameter is valid only if the StorageClass parameter is set to ARCHIVE. The minimum billable size of the data stored at the Archive tier is 1 MB.', example='1048576'),
      options?: string(name='Options', description='This parameter is valid only if the **SourceType** parameter is set to **ECS_FILE**. This parameter indicates whether Windows Volume Shadow Copy Service (VSS) is used to define a restoration path.

*   This parameter is available only for Windows ECS instances.
*   If data changes occur in the backup source, the source data must be the same as the data to be backed up before you can set this parameter to `["UseVSS":true]`.
*   If you use VSS, you cannot restore data from multiple directories.', example='{"UseVSS":false}'),
      otsDetail?: {
        batchChannelCount?: int32(name='BatchChannelCount', description='The number of channels processed by each Tablestore restore job.', example='2'),
        overwriteExisting?: boolean(name='OverwriteExisting', description='Indicates whether the existing Tablestore restore job was overwritten.', example='false'),
      }(name='OtsDetail', description='The details about the Tablestore instance.'),
      parentId?: string(name='ParentId', description='The ID of the parent job.', example='r-0003hd2an3x4dyv0l18b'),
      progress?: int32(name='Progress', description='The progress of the restore job. Valid values: [0,10000]. For example, 10000 indicates that the progress is 100%.', example='10000'),
      report?: {
        failedFiles?: string(name='FailedFiles', description='The files that failed to be executed.', example='/temp/report/158975xxxxxx4625/r-0001hfxxxxxymsspjjtl/job-0001hfxxxxxymsspjjtl_failed.zip'),
        reportTaskStatus?: string(name='ReportTaskStatus', description='The status of the report generation.', example='COMPLETE'),
        skippedFiles?: string(name='SkippedFiles', description='The skipped files.', example='/temp/report/158975xxxxxx4625/r-0001hfxxxxxymsspjjtl/job-0001hfxxxxxymsspjjtl_skipped.zip'),
        successFiles?: string(name='SuccessFiles', description='The files that are successfully executed.', example='/temp/report/158975xxxxxx4625/r-0001hfxxxxxymsspjjtl/job-0001hfxxxxxymsspjjtl_success.zip'),
        totalFiles?: string(name='TotalFiles', description='The full files that are restored based on the file list.', example='/temp/report/158975xxxxxx4625/job-0001hfxxxxxymsspjjtl/job-0001hfxxxxxymsspjjtl_total.csv'),
      }(name='Report', description='The report of the restore job.'),
      restoreId?: string(name='RestoreId', description='The ID of the restore job.', example='r-0003*****8a'),
      restoreType?: string(name='RestoreType', description='The type of the restore job.', example='ECS_FILE'),
      snapshotHash?: string(name='SnapshotHash', description='The hash value of the backup snapshot.', example='f2fe...'),
      snapshotId?: string(name='SnapshotId', description='The ID of the snapshot used for restoration.', example='s-0002******ga88'),
      sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **ECS_FILE**: ECS files
*   **OSS**: Object Storage Service (OSS) buckets
*   **NAS**: Apsara File Storage NAS (NAS) file systems
*   **OTS_TABLE**: Tablestore instances
*   **UDM_ECS**: ECS instances', example='ECS_FILE'),
      speed?: long(name='Speed', description='The average speed at which data is backed up. Unit: KB/s.', example='500'),
      startTime?: long(name='StartTime', description='The time when the restore job started. This value is a UNIX timestamp. Unit: seconds.', example='1554347313'),
      status?: string(name='Status', description='The status of the restore job. Valid values:

*   **COMPLETE**: The job is completed.
*   **PARTIAL_COMPLETE**: The job is partially completed.
*   **FAILED**: The job failed.', example='COMPLETE'),
      storageClass?: string(name='StorageClass', description='The storage class of the backup data. Valid values:

*   **STANDARD**
*   **ARCHIVE**', example='STANDARD'),
      targetBucket?: string(name='TargetBucket', description='The name of the destination OSS bucket. This parameter is returned only for OSS buckets.', example='target-bucket'),
      targetClientId?: string(name='TargetClientId', description='The ID of the destination client.', example='c-000e*****397'),
      targetCreateTime?: long(name='TargetCreateTime', description='The time when the file system was created. This parameter is returned only for NAS file systems.', example='1634714531'),
      targetDataSourceId?: string(name='TargetDataSourceId', description='The ID of the destination data source.', example='ds-000*****997'),
      targetFileSystemId?: string(name='TargetFileSystemId', description='The ID of the destination NAS file system. This parameter is returned only for NAS file systems.', example='0be9****9c9'),
      targetInstanceId?: string(name='TargetInstanceId', description='The ID of the destination instance for the restore job.', example='i-2ze3m7ktcgw******cs'),
      targetInstanceName?: string(name='TargetInstanceName', description='The name of the destination Tablestore instance.', example='instancename'),
      targetPath?: string(name='TargetPath', description='The destination file path of the restore job.', example='"D:\\\\\\\\rebk"'),
      targetPrefix?: string(name='TargetPrefix', description='The prefix of the objects that are restored. This parameter is returned only for OSS buckets.', example='"/target"'),
      targetTableName?: string(name='TargetTableName', description='The name of the destination table in the Tablestore instance.', example='tablename'),
      targetTime?: long(name='TargetTime', description='The time when the Tablestore instance was backed up. This value is a UNIX timestamp. Unit: seconds.', example='1642560261'),
      udmDetail?: string(name='UdmDetail', description='The details about Elastic Compute Service (ECS) instance backup.', example='{\\\\"doCopy\\\\":true,\\\\"doBackup\\\\":false,\\\\"instanceName\\\\":\\\\"instance example\\\\",\\\\"appConsistent\\\\":false,\\\\"destinationRegionId\\\\":\\\\"cn-shanghai\\\\",\\\\"enableFsFreeze\\\\":true,\\\\"osNameEn\\\\":\\\\"Windows Server  2019 Data Center Edition 64bit Chinese Edition\\\\",\\\\"osName\\\\":\\\\"Windows Server  2019 Data Center Edition 64bit Chinese Edition\\\\",\\\\"diskIdList\\\\":[],\\\\"backupVaultId\\\\":\\\\"\\\\",\\\\"snapshotGroup\\\\":true,\\\\"destinationRetention\\\\":35,\\\\"platform\\\\":\\\\"Windows Server 2012\\\\",\\\\"timeoutInSeconds\\\\":60,\\\\"backupRetention\\\\":1,\\\\"osType\\\\":\\\\"windows\\\\",\\\\"preScriptPath\\\\":\\\\"\\\\",\\\\"postScriptPath\\\\":\\\\"\\\\",\\\\"enableWriters\\\\":true,\\\\"ecsDeleted\\\\":false}'),
      updatedTime?: long(name='UpdatedTime', description='The time when the restore job was updated. This value is a UNIX timestamp. Unit: seconds.', example='1554347313'),
      vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-0006******q'),
    }
  ](name='RestoreJob')
  }(name='RestoreJobs', description='The queried restore jobs.', example='{\\\\"RestoreJob\\\\": []}'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model DescribeRestoreJobs2Response = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRestoreJobs2ResponseBody(name='body'),
}

/**
 * @summary Queries one or more restore jobs that meet the specified conditions.
 *
 * @param request DescribeRestoreJobs2Request
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRestoreJobs2Response
 */
async function describeRestoreJobs2WithOptions(request: DescribeRestoreJobs2Request, runtime: Util.RuntimeOptions): DescribeRestoreJobs2Response {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.filters)) {
    query['Filters'] = request.filters;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.restoreType)) {
    query['RestoreType'] = request.restoreType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRestoreJobs2',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries one or more restore jobs that meet the specified conditions.
 *
 * @param request DescribeRestoreJobs2Request
 * @return DescribeRestoreJobs2Response
 */
async function describeRestoreJobs2(request: DescribeRestoreJobs2Request): DescribeRestoreJobs2Response {
  var runtime = new Util.RuntimeOptions{};
  return describeRestoreJobs2WithOptions(request, runtime);
}

model DescribeTaskRequest {
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmvywqfey5njq'),
  taskId?: string(name='TaskId', description='The ID of the job.', example='t-*********************'),
  token?: string(name='Token', description='The access token.', example='01W3ZZOQ'),
}

model DescribeTaskResponseBody = {
  code?: string(name='Code', description='HttpCode', example='200'),
  completedTime?: long(name='CompletedTime', description='The time when the task was complete. The time is a UNIX timestamp. Unit: seconds.', example='1615607706'),
  createdTime?: long(name='CreatedTime', description='The time when the job was created. This value is a UNIX timestamp. Unit: seconds.', example='1615607706'),
  description?: string(name='Description', description='The status of the job. Valid values:

*   **created**: The job is created.
*   **expired**: The job expires.
*   **completed**: The job is completed.
*   **cancelled**: The job is canceled.', example='completed'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  name?: string(name='Name', description='The name of the job.', example='InstallBackupClientsTask'),
  progress?: int32(name='Progress', description='The progress of the job. Valid values: 0 to 100. Unit: percentage (%). If the job fails, the value -1 is returned.', example='100'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  result?: string(name='Result', description='The result of the job.', example='{}'),
  success?: boolean(name='Success', description='Indicates whether the call is successful.

*   true: The call is successful.
*   false: The call fails.', example='true'),
  updatedTime?: long(name='UpdatedTime', description='The time when the job was updated. This value is a UNIX timestamp. Unit: seconds.', example='1615607706'),
}

model DescribeTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTaskResponseBody(name='body'),
}

/**
 * @summary Queries an asynchronous job.
 *
 * @param request DescribeTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTaskResponse
 */
async function describeTaskWithOptions(request: DescribeTaskRequest, runtime: Util.RuntimeOptions): DescribeTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  if (!Util.isUnset(request.token)) {
    query['Token'] = request.token;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTask',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries an asynchronous job.
 *
 * @param request DescribeTaskRequest
 * @return DescribeTaskResponse
 */
async function describeTask(request: DescribeTaskRequest): DescribeTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTaskWithOptions(request, runtime);
}

model DescribeUdmSnapshotsRequest {
  diskId?: string(name='DiskId', description='The ID of the disk.', example='d-bp1560750pclffpzxy70'),
  endTime?: long(name='EndTime', description='The end of the time range to query. The value must be a UNIX timestamp. Unit: seconds.

This parameter is required.', example='1643092168'),
  instanceId?: string(name='InstanceId', description='The ID of the ECS instance.', example='i-bp18x2k7sw925ir7ofh8'),
  jobId?: string(name='JobId', description='The ID of the backup job.', example='job-*********************'),
  snapshotIds?: map[string]any(name='SnapshotIds', description='The list of backup snapshots.', example='[\\\\"s-000e3vhhu62xsm6v92r0\\\\"]'),
  sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **UDM_ECS**: ECS instance backup
*   **UDM_ECS_DISK**: disk backup subtask of ECS instance backup
*   **UDM_DISK**: disk backup

This parameter is required.', example='UDM_ECS'),
  startTime?: long(name='StartTime', description='The beginning of the time range to query. The value must be a UNIX timestamp. Unit: seconds.

This parameter is required.', example='1642057551'),
  udmRegionId?: string(name='UdmRegionId', description='The ID of the region where the ECS instance resides.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeUdmSnapshotsShrinkRequest {
  diskId?: string(name='DiskId', description='The ID of the disk.', example='d-bp1560750pclffpzxy70'),
  endTime?: long(name='EndTime', description='The end of the time range to query. The value must be a UNIX timestamp. Unit: seconds.

This parameter is required.', example='1643092168'),
  instanceId?: string(name='InstanceId', description='The ID of the ECS instance.', example='i-bp18x2k7sw925ir7ofh8'),
  jobId?: string(name='JobId', description='The ID of the backup job.', example='job-*********************'),
  snapshotIdsShrink?: string(name='SnapshotIds', description='The list of backup snapshots.', example='[\\\\"s-000e3vhhu62xsm6v92r0\\\\"]'),
  sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **UDM_ECS**: ECS instance backup
*   **UDM_ECS_DISK**: disk backup subtask of ECS instance backup
*   **UDM_DISK**: disk backup

This parameter is required.', example='UDM_ECS'),
  startTime?: long(name='StartTime', description='The beginning of the time range to query. The value must be a UNIX timestamp. Unit: seconds.

This parameter is required.', example='1642057551'),
  udmRegionId?: string(name='UdmRegionId', description='The ID of the region where the ECS instance resides.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeUdmSnapshotsResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='51CDEECB-7001-51CC-94AC-2A0F2A4B71D2'),
  snapshots?: [ 
    {
      actualBytes?: string(name='ActualBytes', description='The size of the backup snapshot. Unit: bytes.', example='600'),
      advancedRetentionType?: string(name='AdvancedRetentionType', description='The special retention type, which is valid only for special backups. Valid values:

*   **WEEKLY**: weekly backups
*   **MONTHLY**: monthly backups
*   **YEARLY**: yearly backups', example='WEEKLY'),
      backupType?: string(name='BackupType', description='The backup type. Valid value: **COMPLETE**, which indicates full backup.', example='COMPLETE'),
      bytesTotal?: long(name='BytesTotal', description='The total amount of data. Unit: bytes.', example='1000'),
      canBeDeleted?: boolean(name='CanBeDeleted', description='Indicates whether the disk backup point can be deleted. This parameter is valid only if the value of SourceType is UDM_ECS_DISK.', example='false', nullable=true),
      completeTime?: long(name='CompleteTime', description='The time when the backup snapshot was completed. The value is a UNIX timestamp. Unit: seconds.', example='1646895666'),
      createTime?: long(name='CreateTime', description='The time when the backup snapshot was created.', example='1607436917'),
      createdTime?: long(name='CreatedTime', description='The time when the backup snapshot was created. The value is a UNIX timestamp. Unit: seconds.', example='1642496679'),
      detail?: {
        consistentLevel?: string(name='ConsistentLevel', description='The consistency level.', example='CRASH'),
        containOsDisk?: boolean(name='ContainOsDisk', description='Indicates whether the system disk is included.', example='true'),
        diskCategory?: string(name='DiskCategory', description='The type of the source disk.', example='cloud_essd'),
        diskDevName?: string(name='DiskDevName', description='The name of the disk.', example='/dev/xvdb'),
        diskHbrSnapshotIdWithDeviceMap?: map[string]any(name='DiskHbrSnapshotIdWithDeviceMap', description='The mapping between the device and the recovery point ID.', example='{
    "/dev/xvdb":"s-0000u7y6wm3v1e7hxh5a",					 
    "/dev/xvda":"s-0004bl6yr5pt89jjsv5a"
}'),
        diskIdList?: [ string ](name='DiskIdList', description='The IDs of the disks that are backed up at the recovery point.'),
        downgradeReason?: string(name='DowngradeReason', description='The reason for the downgrade.', example='HBR.NoRamRoleBound'),
        hostName?: string(name='HostName', description='The hostname.', example='iZbpxxxxxxxxxxxxxxxxe2Z'),
        instanceIdWithDiskIdListMap?: map[string]any(name='InstanceIdWithDiskIdListMap', description='The mapping between the instance ID and the disk ID.', example='{
    "i-bp1dlp0keohh7ids4uo6":"d-bp1e6427vhd320hifvs",					 
    "i-bp1dlp0keohh7ids4uo6":"d-bp1e6427vhd320hifvd"
}'),
        instanceName?: string(name='InstanceName', description='The name of the instance.', example='swh-hbr'),
        instanceType?: string(name='InstanceType', description='The specifications of the source instance.', example='ecs.c6.xlarge'),
        instantAccess?: boolean(name='InstantAccess', description='Indicates whether the backup is created by the instant clone feature.', example='false'),
        nativeSnapshotIdList?: [ string ](name='NativeSnapshotIdList', description='The list of snapshot IDs, corresponding to DiskIdList.'),
        osDiskId?: string(name='OsDiskId', description='The ID of the system disk.', example='d-bp1e6427vhd320hifvc'),
        osName?: string(name='OsName', description='The name of the operating system.', example='Debian 10.10 64-bit (UEFI)'),
        osNameEn?: string(name='OsNameEn', description='The English name of the operating system.', example='Debian  11.1 64 bit'),
        osType?: string(name='OsType', description='The type of the operating system. Valid values: linux and windows.', example='windows'),
        performanceLevel?: string(name='PerformanceLevel', description='The performance level of the source disk.', example='PL0'),
        platform?: string(name='Platform', description='The system platform.', example='CentOS'),
        snapshotGroupId?: string(name='SnapshotGroupId', description='The ID of the snapshot group.', example='ssg-uf6856txcaq31uj***'),
        systemDisk?: boolean(name='SystemDisk', description='Indicates whether the disk is a system disk.', example='true'),
        vmName?: string(name='VmName', description='The name of the instance.', example='BNSHSVR42 IPGUARD'),
      }(name='Detail', description='The snapshot details.'),
      diskId?: string(name='DiskId', description='The ID of the cloud disk or local disk.', example='d-2ze86h5fga5rfwxxa8ef'),
      expireTime?: long(name='ExpireTime', description='The expiration time of the backup.', example='1640334062'),
      instanceId?: string(name='InstanceId', description='The ID of the ECS instance.', example='i-bp1f0pe78dxizrsdcgxd'),
      jobId?: string(name='JobId', description='The ID of the backup job.', example='job-00030j3chkt******2'),
      nativeSnapshotId?: string(name='NativeSnapshotId', description='The ID of the backup snapshot.', example='s-00047mg17p26x*****b'),
      nativeSnapshotInfo?: string(name='NativeSnapshotInfo', description='The snapshot information.', example='{
					"sourceDiskId":"d-bp17misjuy636t82v7b0",
					"lastModifiedTime":"2022-03-09T11:35:12Z",
					"snapshotSN":"64588-429372675-857161235",
					"snapshotId":"s-bp1fbtwv3e6xr6wpe9e0",
					"creationTime":"2022-03-09T11:31:12Z",
					"snapshotType":"user",
					"usage":"none",
					"description":"",
					"sourceStorageType":"disk",
					"tags":[
						{
							"tagValue":"job-0007e0wqjl0imbrtkmnm",
							"tagKey":"HBR JobId"
						}
					],
					"productCode":"",
					"encrypted":false,
					"sourceDiskType":"system",
					"retentionDays":30,
					"snapshotName":"Created-from-HBR-job:job-0007e0wqjl0imbrtkmnm",
					"kMSKeyId":"",
					"progress":"100%",
					"category":"standard",
					"sourceDiskSize":"20",
					"status":"accomplished"
				}'),
      parentSnapshotHash?: string(name='ParentSnapshotHash', description='The hash value of the parent backup snapshot.', example='f2fe..'),
      prefix?: string(name='Prefix', description='The prefix of the backup snapshot.', example='example/'),
      realSnapshotTime?: long(name='RealSnapshotTime', description='The timestamp of the backup snapshot. The value is a UNIX timestamp. Unit: seconds.', example='1642496679'),
      retention?: long(name='Retention', description='The retention period of the backup snapshot. Unit: days.', example='7'),
      snapshotHash?: string(name='SnapshotHash', description='The hash value of the backup snapshot.', example='f2fe...'),
      snapshotId?: string(name='SnapshotId', description='The ID of the backup snapshot.', example='s-00047mxg17p26*****b'),
      sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **UDM_ECS**: ECS instance backup
*   **UDM_ECS_DISK**: disk backup subtask of ECS instance backup
*   **UDM_DISK**: disk backup', example='UDM_ECS'),
      startTime?: long(name='StartTime', description='The time when the backup snapshot was created. The value is a UNIX timestamp. Unit: seconds.', example='1554347313'),
      status?: string(name='Status', description='The status of the backup job. Valid values:

*   **COMPLETE**: The backup job is completed.
*   **PARTIAL_COMPLETE**: The backup job is partially completed.
*   **FAILED**: The backup job has failed.', example='COMPLETE'),
      updatedTime?: long(name='UpdatedTime', description='The time when the backup snapshot was updated. The value is a UNIX timestamp. Unit: seconds.', example='1642496679'),
    }
  ](name='Snapshots', description='The details about snapshots.'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
  totalCount?: long(name='TotalCount', description='The total number of backup snapshots.', example='3'),
}

model DescribeUdmSnapshotsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeUdmSnapshotsResponseBody(name='body'),
}

/**
 * @summary Queries the backup snapshots of an Elastic Compute Service (ECS) instance.
 *
 * @param tmpReq DescribeUdmSnapshotsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeUdmSnapshotsResponse
 */
async function describeUdmSnapshotsWithOptions(tmpReq: DescribeUdmSnapshotsRequest, runtime: Util.RuntimeOptions): DescribeUdmSnapshotsResponse {
  Util.validateModel(tmpReq);
  var request = new DescribeUdmSnapshotsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.snapshotIds)) {
    request.snapshotIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.snapshotIds, 'SnapshotIds', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.diskId)) {
    query['DiskId'] = request.diskId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.udmRegionId)) {
    query['UdmRegionId'] = request.udmRegionId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.snapshotIdsShrink)) {
    body['SnapshotIds'] = request.snapshotIdsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeUdmSnapshots',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the backup snapshots of an Elastic Compute Service (ECS) instance.
 *
 * @param request DescribeUdmSnapshotsRequest
 * @return DescribeUdmSnapshotsResponse
 */
async function describeUdmSnapshots(request: DescribeUdmSnapshotsRequest): DescribeUdmSnapshotsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeUdmSnapshotsWithOptions(request, runtime);
}

model DescribeVaultReplicationRegionsRequest {
  token?: string(name='Token', description='This parameter is deprecated.', example='01W3ZZOQ'),
  vaultId?: string(name='VaultId', description='This parameter is deprecated.', example='v-00030j3c******sn', deprecated=true),
}

model DescribeVaultReplicationRegionsResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  regions?: {
    regionId?: [ string ](name='RegionId')
  }(name='Regions', description='The regions that support cross-region replication.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F4EEB401-DD21-588D-AE3B-1E835C7655E1'),
  success?: boolean(name='Success', description='Indicates whether the call is successful.

*   true: The call is successful.
*   false: The call fails.', example='true'),
}

model DescribeVaultReplicationRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVaultReplicationRegionsResponseBody(name='body'),
}

/**
 * @summary Queries the regions that support cross-region replication.
 *
 * @param request DescribeVaultReplicationRegionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVaultReplicationRegionsResponse
 */
async function describeVaultReplicationRegionsWithOptions(request: DescribeVaultReplicationRegionsRequest, runtime: Util.RuntimeOptions): DescribeVaultReplicationRegionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.token)) {
    query['Token'] = request.token;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeVaultReplicationRegions',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the regions that support cross-region replication.
 *
 * @param request DescribeVaultReplicationRegionsRequest
 * @return DescribeVaultReplicationRegionsResponse
 */
async function describeVaultReplicationRegions(request: DescribeVaultReplicationRegionsRequest): DescribeVaultReplicationRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeVaultReplicationRegionsWithOptions(request, runtime);
}

model DescribeVaultsRequest {
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 99. Default value: 10.', example='10'),
  resourceGroupId?: string(name='ResourceGroupId', description='Resource group ID.', example='rg-*********************'),
  status?: string(name='Status', description='The status of the backup vault. Valid values:

*   **UNKNOWN**: The backup vault is in an unknown state.
*   **INITIALIZING**: The backup vault is being initialized.
*   **CREATED**: The backup vault is created.
*   **ERROR**: An error occurs on the backup vault.', example='CREATED'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag.', example='key1'),
      value?: string(name='Value', description='The Value of the tag.', example='value1'),
    }
  ](name='Tag', description='Tag information. Supports up to 20 tags.', example='6a745bceffb042959b3b5206d6f12ad1'),
  vaultId?: string(name='VaultId', description='Backup vault ID.', example='v-*********************'),
  vaultName?: string(name='VaultName', description='The name of the backup vault. The name must be 1 to 64 characters in length.', example='vaultname'),
  vaultRegionId?: string(name='VaultRegionId', description='The region ID to which the backup vault belongs.', example='cn-shanghai'),
  vaultType?: string(name='VaultType', description='Backup repository type. The values are as follows: 
- **STANDARD**: Represents a standard repository, which can be used for ECS file backups, OSS backups, NAS backups, etc. 
- **OTS_BACKUP**: Represents a TableStore repository, which is only used for TableStore backups, and TableStore must use this type of repository.', example='STANDARD'),
}

model DescribeVaultsResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  pageNumber?: int32(name='PageNumber', description='Page number for pagination, starting from 1. The default value is 1.', example='1'),
  pageSize?: int32(name='PageSize', description='Page size, with a minimum value of 1, a maximum value of 99, and a default value of 10.', example='10'),
  requestId?: string(name='RequestId', description='Request ID.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Whether the request was successful.
- true: Success - false: Failure', example='true'),
  totalCount?: int32(name='TotalCount', description='Returns the total number of backup repositories.', example='8'),
  vaults?: {
    vault?: [ 
    {
      archiveBytesDone?: long(name='ArchiveBytesDone', description='Archival tier backup data volume. Unit: bytes.', example='1024000'),
      archiveStorageSize?: long(name='ArchiveStorageSize', description='The billable storage usage of the Archive tier. Unit: bytes.', example='1024000'),
      backupPlanStatistics?: {
        archive?: int32(name='Archive', description='The number of archive plans.', example='1'),
        commonFileSystem?: int32(name='CommonFileSystem', description='The number of Cloud Parallel File Storage (CPFS) backup plans.', example='1'),
        commonNas?: int32(name='CommonNas', description='The number of backup plans for General-purpose NAS file systems.', example='1'),
        csg?: int32(name='Csg', description='The number of backup plans for Cloud Storage Gateway (CSG) gateways.', example='1'),
        ecsFile?: int32(name='EcsFile', description='The number of backup plans for ECS files.', example='1'),
        ecsHana?: int32(name='EcsHana', description='The number of backup plans for SAP HANA instances.', example='1'),
        isilon?: int32(name='Isilon', description='The number of backup plans for Isilon storage systems.', example='1'),
        localFile?: int32(name='LocalFile', description='The number of backup plans for on-premises servers.', example='1'),
        localVm?: int32(name='LocalVm', description='The number of backup plans for on-premises virtual machines (VMs).', example='1'),
        mySql?: int32(name='MySql', description='The number of backup plans for MySQL databases.', example='1'),
        nas?: int32(name='Nas', description='The number of backup plans for NAS file systems.', example='1'),
        oracle?: int32(name='Oracle', description='The number of backup plans for Oracle databases.', example='1'),
        oss?: int32(name='Oss', description='The number of backup plans for OSS buckets.', example='1'),
        ots?: int32(name='Ots', description='The number of backup plans for Tablestore instances.', example='1'),
        sqlServer?: int32(name='SqlServer', description='The number of backup plans for SQL Server databases.', example='1'),
      }(name='BackupPlanStatistics', description='The statistics of backup plans that use the backup vault.'),
      bucketName?: string(name='BucketName', description='The name of the OSS bucket used by the backup vault.', example='hbr-0005i51******t58'),
      bytesDone?: long(name='BytesDone', description='The amount of data that is backed up. Unit: bytes.', example='20'),
      chargeType?: string(name='ChargeType', description='The billing method of the backup vault.', example='FREE'),
      chargedStorageSize?: long(name='ChargedStorageSize', description='The billable storage usage of the archive vault. Unit: bytes.', example='1024000'),
      compressionAlgorithm?: string(name='CompressionAlgorithm', description='The encryption algorithm used to compress the backup vault. Valid values:

*   DISABLED: The backup vault is not compressed.
*   SNAPPY: The backup vault is compressed by using the SNAPPY encryption algorithm.
*   ZSTD: The backup vault is compressed by using Zstandard, a fast lossless compression algorithm.', example='ZSTD'),
      createdTime?: long(name='CreatedTime', description='The time when the backup vault was created. The value is a UNIX timestamp. Unit: seconds.', example='1554347313'),
      dedup?: boolean(name='Dedup', description='Indicates whether the deduplication feature is enabled.', example='true'),
      description?: string(name='Description', description='The description of the backup vault.', example='vault description'),
      encryptType?: string(name='EncryptType', description='The encryption type of the backup vault. Valid values:

*   NONE: The backup vault is not encrypted.
*   HBR_PRIVATE (default): The backup vault is encrypted by using a key provided by Cloud Backup.
*   KMS: The backup vault is encrypted by using a custom master key (CMK) created in Key Management Service (KMS).', example='HBR_PRIVATE'),
      indexAvailable?: boolean(name='IndexAvailable', description='Indicates whether indexes are available. Indexes are available when they are not being updated.', example='true'),
      indexLevel?: string(name='IndexLevel', description='The index level.

*   OFF: No indexes are created.
*   META: Metadata indexes are created.
*   ALL: Full-text indexes are created.', example='OFF'),
      indexUpdateTime?: long(name='IndexUpdateTime', description='The time when the index was updated.', example='1639645628'),
      kmsKeyId?: string(name='KmsKeyId', description='The ID or alias of the CMK created in KMS. This parameter is returned only when EncryptType is set to KMS.', example='alias/acs/acm'),
      latestReplicationTime?: long(name='LatestReplicationTime', description='The time when the last remote backup was synchronized. The value is a UNIX timestamp. Unit: seconds.', example='1554347313'),
      redundancyType?: string(name='RedundancyType', description='The data redundancy type of the backup vault. Valid values:

*   LRS: Locally redundant storage (LRS) is enabled for the backup vault. Cloud Backup stores the copies of each object on multiple devices of different facilities in the same zone. This way, Cloud Backup ensures data durability and availability even if hardware failures occur.
*   ZRS: Zone-redundant storage (ZRS) is enabled for the backup vault. Cloud Backup uses the multi-zone mechanism to distribute data across three zones within the same region. If a zone fails, the data that is stored in the other two zones is still accessible.', example='LRS'),
      replication?: boolean(name='Replication', description='Indicates whether the backup vault is a remote backup vault. Valid values:

*   true: The backup vault is a remote backup vault.
*   false: The backup vault is a local backup vault.', example='false'),
      replicationProgress?: {
        historicalReplicationProgress?: int32(name='HistoricalReplicationProgress', description='The progress of historical data synchronization from the backup vault to the mirror vault. Valid values: 0 to 100.', example='100'),
        newReplicationProgress?: long(name='NewReplicationProgress', description='The latest synchronization time of incremental data in the mirror vault.', example='1579413159'),
      }(name='ReplicationProgress', description='The progress of data synchronization from the backup vault to the mirror vault.'),
      replicationSourceRegionId?: string(name='ReplicationSourceRegionId', description='The ID of the region in which the source vault resides. This parameter is valid only for remote backup vaults.', example='v-*********************'),
      replicationSourceVault?: boolean(name='ReplicationSourceVault', description='Indicate whether the backup vault is the source vault that corresponds to the remote backup vault. Valid values:

*   true
*   false', example='false'),
      replicationSourceVaultId?: string(name='ReplicationSourceVaultId', description='The ID of the source vault that corresponds to the remote backup vault.', example='v-*********************'),
      replicationTargetRegionId?: string(name='ReplicationTargetRegionId', description='Target region for remote backup repository.', example='cn-shanghai'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-*********************'),
      retention?: long(name='Retention', description='The retention period of the backup vault. Unit: days.', example='2'),
      searchEnabled?: boolean(name='SearchEnabled', description='Indicates whether the backup search feature is enabled.', example='true'),
      snapshotCount?: long(name='SnapshotCount', description='The number of snapshots in the backup vault.', example='0'),
      sourceTypes?: {
        sourceType?: [ string ](name='SourceType')
      }(name='SourceTypes', description='The data source types of the backup vault.'),
      status?: string(name='Status', description='The status of the backup vault. Valid values:

*   **UNKNOWN**: The backup vault is in an unknown state.
*   **INITIALIZING**: The backup vault is being initialized.
*   **CREATED**: The backup vault is created.
*   **ERROR**: An error occurs on the backup vault.', example='CREATED'),
      storageSize?: long(name='StorageSize', description='The usage of the backup vault. Unit: bytes.', example='10'),
      tags?: {
        tag?: [ 
        {
          key?: string(name='Key', description='The tag key of the backup vault. Valid values of N: 1 to 20.

*   The tag key cannot start with `aliyun` or `acs:`.
*   The tag key cannot contain `http://` or `https://`.
*   The tag key cannot be an empty string.', example='aaa'),
          value?: string(name='Value', description='The tag value of the backup vault. Valid values of N: 1 to 20.

*   The tag value cannot start with `aliyun` or `acs:`.
*   The tag value cannot contain `http://` or `https://`.
*   The tag value cannot be an empty string.', example='a1'),
        }
      ](name='Tag')
      }(name='Tags', description='The tags of the backup vault.'),
      trialInfo?: {
        keepAfterTrialExpiration?: boolean(name='KeepAfterTrialExpiration', description='Indicates whether you are billed based on the pay-as-you-go method after the free trial ends.', example='true'),
        trialExpireTime?: long(name='TrialExpireTime', description='The expiration time of the free trial.', example='1584597600'),
        trialStartTime?: long(name='TrialStartTime', description='The start time of the free trial.', example='1579413159'),
        trialVaultReleaseTime?: long(name='TrialVaultReleaseTime', description='The time when the free-trial backup vault is released.', example='1594965600'),
      }(name='TrialInfo', description='The free trial information.'),
      updatedTime?: long(name='UpdatedTime', description='The time when the backup vault was updated. The value is a UNIX timestamp. Unit: seconds.', example='1554347313'),
      vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-*********************'),
      vaultName?: string(name='VaultName', description='The name of the backup vault.', example='vaultname'),
      vaultRegionId?: string(name='VaultRegionId', description='The ID of the region in which the backup vault resides.', example='cn-shanghai'),
      vaultStatusMessage?: string(name='VaultStatusMessage', description='The status message that is returned when the backup vault is in the ERROR state. This parameter is valid only for remote backup vaults. Valid values:

*   **UNKNOWN_ERROR**: An unknown error occurs.
*   **SOURCE_VAULT_ALREADY_HAS_REPLICATION**: A mirror vault is configured for the source vault.', example='SOURCE_VAULT_ALREADY_HAS_REPLICATION'),
      vaultStorageClass?: string(name='VaultStorageClass', description='The storage class of the backup vault. Valid value: **STANDARD**, which indicates standard storage.', example='STANDARD'),
      vaultType?: string(name='VaultType', description='The type of the backup vault. Valid value: **STANDARD**, which indicates a standard backup vault.', example='STANDARD'),
      wormEnabled?: boolean(name='WormEnabled', description='Indicates whether the immutable backup feature is enabled.', example='true'),
    }
  ](name='Vault')
  }(name='Vaults', description='The backup vaults.', example='{\\\\"Vault\\\\": []}'),
}

model DescribeVaultsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVaultsResponseBody(name='body'),
}

/**
 * @summary Queries the information about one or more backup vaults that meet the specified conditions.
 *
 * @param request DescribeVaultsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVaultsResponse
 */
async function describeVaultsWithOptions(request: DescribeVaultsRequest, runtime: Util.RuntimeOptions): DescribeVaultsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  if (!Util.isUnset(request.vaultName)) {
    query['VaultName'] = request.vaultName;
  }
  if (!Util.isUnset(request.vaultRegionId)) {
    query['VaultRegionId'] = request.vaultRegionId;
  }
  if (!Util.isUnset(request.vaultType)) {
    query['VaultType'] = request.vaultType;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.tag)) {
    body['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeVaults',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the information about one or more backup vaults that meet the specified conditions.
 *
 * @param request DescribeVaultsRequest
 * @return DescribeVaultsResponse
 */
async function describeVaults(request: DescribeVaultsRequest): DescribeVaultsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeVaultsWithOptions(request, runtime);
}

model DetachNasFileSystemRequest {
  createTime?: string(name='CreateTime', description='The time when the file system was created. The value must be a UNIX timestamp. Unit: seconds.

This parameter is required.', example='1607436917'),
  crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the RAM role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up and restore data across Alibaba Cloud accounts.', example='BackupRole'),
  crossAccountType?: string(name='CrossAccountType', description='Specifies whether data is backed up and restored within the same Alibaba Cloud account or across Alibaba Cloud accounts. Valid values:

*   SELF_ACCOUNT: Data is backed up and restored within the same Alibaba Cloud account.
*   CROSS_ACCOUNT: Data is backed up and restored across Alibaba Cloud accounts.', example='SELF_ACCOUNT'),
  crossAccountUserId?: long(name='CrossAccountUserId', description='The ID of the source Alibaba Cloud account that authorizes the current Alibaba Cloud account to back up and restore data across Alibaba Cloud accounts.', example='158975xxxxx4625'),
  fileSystemId?: string(name='FileSystemId', description='The ID of the file system.

This parameter is required.', example='005494'),
}

model DetachNasFileSystemResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the request is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the request is successful, a value of successful is returned. If the request fails, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.

*   true: The request is successful.
*   false: The request fails.', example='true'),
  taskId?: string(name='TaskId', description='The ID of the asynchronous job. You can call the DescribeTask operation to query the execution result of the asynchronous job.', example='t-*********************'),
}

model DetachNasFileSystemResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DetachNasFileSystemResponseBody(name='body'),
}

/**
 * @summary Deletes an internal mount target created by Cloud Backup.
 *
 * @description *   If the request is successful, the mount target is deleted.
 * *   After you create a backup plan for an Apsara File Storage NAS file system, HBR automatically creates a mount target for the file system. You can call this operation to delete the mount target. In the **Status** column of the mount target of the NAS file system, the following information is displayed: **This mount target is created by an Alibaba Cloud internal service and cannot be operated. Service name: HBR**.
 *
 * @param request DetachNasFileSystemRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DetachNasFileSystemResponse
 */
async function detachNasFileSystemWithOptions(request: DetachNasFileSystemRequest, runtime: Util.RuntimeOptions): DetachNasFileSystemResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.createTime)) {
    query['CreateTime'] = request.createTime;
  }
  if (!Util.isUnset(request.crossAccountRoleName)) {
    query['CrossAccountRoleName'] = request.crossAccountRoleName;
  }
  if (!Util.isUnset(request.crossAccountType)) {
    query['CrossAccountType'] = request.crossAccountType;
  }
  if (!Util.isUnset(request.crossAccountUserId)) {
    query['CrossAccountUserId'] = request.crossAccountUserId;
  }
  if (!Util.isUnset(request.fileSystemId)) {
    query['FileSystemId'] = request.fileSystemId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DetachNasFileSystem',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes an internal mount target created by Cloud Backup.
 *
 * @description *   If the request is successful, the mount target is deleted.
 * *   After you create a backup plan for an Apsara File Storage NAS file system, HBR automatically creates a mount target for the file system. You can call this operation to delete the mount target. In the **Status** column of the mount target of the NAS file system, the following information is displayed: **This mount target is created by an Alibaba Cloud internal service and cannot be operated. Service name: HBR**.
 *
 * @param request DetachNasFileSystemRequest
 * @return DetachNasFileSystemResponse
 */
async function detachNasFileSystem(request: DetachNasFileSystemRequest): DetachNasFileSystemResponse {
  var runtime = new Util.RuntimeOptions{};
  return detachNasFileSystemWithOptions(request, runtime);
}

model DisableBackupPlanRequest {
  planId?: string(name='PlanId', description='The ID of the backup plan.

This parameter is required.', example='plan-*********************'),
  sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **ECS_FILE**: Elastic Compute Service (ECS) files
*   **OSS**: Object Storage Service (OSS) buckets
*   **NAS**: Apsara File Storage NAS (NAS) file systems', example='ECS_FILE'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-*********************'),
}

model DisableBackupPlanResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DisableBackupPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableBackupPlanResponseBody(name='body'),
}

/**
 * @summary Disables a backup plan.
 *
 * @description After you call this operation, the backup plan is suspended. In the DescribeBackupPlans operation, the Disabled parameter is set to true.
 *
 * @param request DisableBackupPlanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableBackupPlanResponse
 */
async function disableBackupPlanWithOptions(request: DisableBackupPlanRequest, runtime: Util.RuntimeOptions): DisableBackupPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableBackupPlan',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Disables a backup plan.
 *
 * @description After you call this operation, the backup plan is suspended. In the DescribeBackupPlans operation, the Disabled parameter is set to true.
 *
 * @param request DisableBackupPlanRequest
 * @return DisableBackupPlanResponse
 */
async function disableBackupPlan(request: DisableBackupPlanRequest): DisableBackupPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableBackupPlanWithOptions(request, runtime);
}

model DisableHanaBackupPlanRequest {
  clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance.

This parameter is required.', example='cl-0003tu******y5oc'),
  planId?: string(name='PlanId', description='The ID of the backup plan.

This parameter is required.', example='pl-0006o11ectqr650ceoct'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfm3erpwweavki'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.

This parameter is required.', example='v-000f9z******vilrr'),
}

model DisableHanaBackupPlanResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='FFC87EC8-8126-5967-9C4D-82715F8DFC97'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DisableHanaBackupPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableHanaBackupPlanResponseBody(name='body'),
}

/**
 * @summary Disables an SAP HANA backup plan.
 *
 * @description To enable the backup plan again, call the EnableHanaBackupPlan operation.
 *
 * @param request DisableHanaBackupPlanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableHanaBackupPlanResponse
 */
async function disableHanaBackupPlanWithOptions(request: DisableHanaBackupPlanRequest, runtime: Util.RuntimeOptions): DisableHanaBackupPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableHanaBackupPlan',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Disables an SAP HANA backup plan.
 *
 * @description To enable the backup plan again, call the EnableHanaBackupPlan operation.
 *
 * @param request DisableHanaBackupPlanRequest
 * @return DisableHanaBackupPlanResponse
 */
async function disableHanaBackupPlan(request: DisableHanaBackupPlanRequest): DisableHanaBackupPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableHanaBackupPlanWithOptions(request, runtime);
}

model EnableBackupPlanRequest {
  planId?: string(name='PlanId', description='The ID of the backup plan.

This parameter is required.', example='plan-*********************'),
  sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **ECS_FILE**: ECS files
*   **OSS**: Object Storage Service (OSS) buckets
*   **NAS**: Apsara File Storage NAS (NAS) file systems', example='ECS_FILE'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-*********************'),
}

model EnableBackupPlanResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model EnableBackupPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableBackupPlanResponseBody(name='body'),
}

/**
 * @summary Enables a backup plan.
 *
 * @description After you call this operation, the backup plan is restarted (Disabled is set to false in the DescribeBackupPlans operation). Cloud Backup continues to perform backups based on the policy specified in the backup plan.
 *
 * @param request EnableBackupPlanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableBackupPlanResponse
 */
async function enableBackupPlanWithOptions(request: EnableBackupPlanRequest, runtime: Util.RuntimeOptions): EnableBackupPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableBackupPlan',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Enables a backup plan.
 *
 * @description After you call this operation, the backup plan is restarted (Disabled is set to false in the DescribeBackupPlans operation). Cloud Backup continues to perform backups based on the policy specified in the backup plan.
 *
 * @param request EnableBackupPlanRequest
 * @return EnableBackupPlanResponse
 */
async function enableBackupPlan(request: EnableBackupPlanRequest): EnableBackupPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableBackupPlanWithOptions(request, runtime);
}

model EnableHanaBackupPlanRequest {
  clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance.

This parameter is required.', example='cl-0001zfcn******0pr3'),
  planId?: string(name='PlanId', description='The ID of the backup plan.

This parameter is required.', example='plan-*********************'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfm4ebtpkzx7zy'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.

This parameter is required.', example='v-00030j3c******sn'),
}

model EnableHanaBackupPlanResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model EnableHanaBackupPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableHanaBackupPlanResponseBody(name='body'),
}

/**
 * @summary Enables an SAP HANA backup plan.
 *
 * @description To disable the backup plan again, call the DisableHanaBackupPlan operation.
 *
 * @param request EnableHanaBackupPlanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableHanaBackupPlanResponse
 */
async function enableHanaBackupPlanWithOptions(request: EnableHanaBackupPlanRequest, runtime: Util.RuntimeOptions): EnableHanaBackupPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableHanaBackupPlan',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Enables an SAP HANA backup plan.
 *
 * @description To disable the backup plan again, call the DisableHanaBackupPlan operation.
 *
 * @param request EnableHanaBackupPlanRequest
 * @return EnableHanaBackupPlanResponse
 */
async function enableHanaBackupPlan(request: EnableHanaBackupPlanRequest): EnableHanaBackupPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableHanaBackupPlanWithOptions(request, runtime);
}

model ExecuteBackupPlanRequest {
  planId?: string(name='PlanId', description='The ID of the backup plan.

This parameter is required.', example='plan-*********************'),
  ruleId?: string(name='RuleId', description='The ID of the backup rule.', example='rule-0002*****ux8'),
  sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **ECS_FILE**: Elastic Compute Service (ECS) files
*   **OSS**: Object Storage Service (OSS) buckets
*   **NAS**: Apsara File Storage NAS (NAS) file systems', example='ECS_FILE'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-*********************'),
}

model ExecuteBackupPlanResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  jobId?: string(name='JobId', description='The ID of the backup job.', example='job-*********************'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model ExecuteBackupPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteBackupPlanResponseBody(name='body'),
}

/**
 * @summary Executes a backup plan.
 *
 * @param request ExecuteBackupPlanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteBackupPlanResponse
 */
async function executeBackupPlanWithOptions(request: ExecuteBackupPlanRequest, runtime: Util.RuntimeOptions): ExecuteBackupPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteBackupPlan',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Executes a backup plan.
 *
 * @param request ExecuteBackupPlanRequest
 * @return ExecuteBackupPlanResponse
 */
async function executeBackupPlan(request: ExecuteBackupPlanRequest): ExecuteBackupPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return executeBackupPlanWithOptions(request, runtime);
}

model ExecutePolicyV2Request {
  dataSourceId?: string(name='DataSourceId', description='Data source ID.', example='i-bp1************dtv'),
  policyId?: string(name='PolicyId', description='Policy ID.

This parameter is required.', example='po-000************hky'),
  ruleId?: string(name='RuleId', description='Rule ID, limited to executing rules of **RuleType** **BACKUP**.

This parameter is required.', example='rule-0002*****ux8'),
  sourceType?: string(name='SourceType', description='Data source type, with the value range as follows:

- **UDM_ECS**: Represents ECS full machine backup.', example='UDM_ECS'),
}

model ExecutePolicyV2ResponseBody = {
  code?: string(name='Code', description='Return code, 200 indicates success.', example='200'),
  jobId?: string(name='JobId', description='Backup job ID.', example='job-*********************'),
  message?: string(name='Message', description='Description of the return message, usually returns \\\\"successful\\\\" on success, and corresponding error messages on failure.', example='successful'),
  requestId?: string(name='RequestId', description='Request ID.', example='F4EEB401-DD21-588D-AE3B-1E835C7655E1'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.

- true: Success
- false: Failure', example='true'),
}

model ExecutePolicyV2Response = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecutePolicyV2ResponseBody(name='body'),
}

/**
 * @summary Execute a policy for one or all bound data sources.
 *
 * @param request ExecutePolicyV2Request
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecutePolicyV2Response
 */
async function executePolicyV2WithOptions(request: ExecutePolicyV2Request, runtime: Util.RuntimeOptions): ExecutePolicyV2Response {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.dataSourceId)) {
    body['DataSourceId'] = request.dataSourceId;
  }
  if (!Util.isUnset(request.policyId)) {
    body['PolicyId'] = request.policyId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExecutePolicyV2',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Execute a policy for one or all bound data sources.
 *
 * @param request ExecutePolicyV2Request
 * @return ExecutePolicyV2Response
 */
async function executePolicyV2(request: ExecutePolicyV2Request): ExecutePolicyV2Response {
  var runtime = new Util.RuntimeOptions{};
  return executePolicyV2WithOptions(request, runtime);
}

model GenerateRamPolicyRequest {
  actionType?: string(name='ActionType', description='The type of policy that you want to generate. Valid values:

*   BACKUP: the permission to back up data to a backup vault
*   RESTORE: the permission to restore data from a backup vault

This parameter is required.', example='system'),
  requireBasePolicy?: boolean(name='RequireBasePolicy', description='Specifies whether to generate the policy based on an existing instance-specific rule. Valid values:

*   true
*   false', example='true'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-*********************'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.

This parameter is required.', example='v-0007al3m******7ao'),
}

model GenerateRamPolicyResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  policyDocument?: string(name='PolicyDocument', description='The content of the policy.', example='{     "Version": "1",     "Statement": [         {             "Effect": "Deny",             "Action": [                 "hbr:CreateRestore",                 "hbr:CreateRestoreJob",                 "hbr:CreateHanaRestore",                 "hbr:CreateUniRestorePlan",                 "hbr:CreateSqlServerRestore"             ],             "Resource": [                 "acs:hbr:*:1178******531:vault/v-000******blx06",                 "acs:hbr:*:1178******531:vault/v-000******blx06/client/*"             ]         }     ] }'),
  requestId?: string(name='RequestId', description='The request ID.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model GenerateRamPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateRamPolicyResponseBody(name='body'),
}

/**
 * @summary Generates a Resource Access Management (RAM) policy.
 *
 * @param request GenerateRamPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateRamPolicyResponse
 */
async function generateRamPolicyWithOptions(request: GenerateRamPolicyRequest, runtime: Util.RuntimeOptions): GenerateRamPolicyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.actionType)) {
    query['ActionType'] = request.actionType;
  }
  if (!Util.isUnset(request.requireBasePolicy)) {
    query['RequireBasePolicy'] = request.requireBasePolicy;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GenerateRamPolicy',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Generates a Resource Access Management (RAM) policy.
 *
 * @param request GenerateRamPolicyRequest
 * @return GenerateRamPolicyResponse
 */
async function generateRamPolicy(request: GenerateRamPolicyRequest): GenerateRamPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return generateRamPolicyWithOptions(request, runtime);
}

model GetTempFileDownloadLinkRequest {
  tempFileKey?: string(name='TempFileKey', description='The key that is used to download a file.

This parameter is required.', example='temp/1797733170015112/report/r-000jdzknbp39cnf9hs99/r-000jdzknbp39cnf9hs99-total.csv'),
}

model GetTempFileDownloadLinkResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the request is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the request is successful, a value of successful is returned. If the request fails, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.

*   true: The request is successful.
*   false: The request fails.', example='true'),
  url?: string(name='Url', description='The download URL of the file.', example='https://a-hbr-temp-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/job-0007yg2i0m6705wdhgb6_0.csv?Expires=1649406469&OSSAccessKeyId=LTAI************&Signature=26%2BgjegCrRmMDCpS5jzyG4ivKU8%3D'),
}

model GetTempFileDownloadLinkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTempFileDownloadLinkResponseBody(name='body'),
}

/**
 * @summary Obtains download links of files such as job reports.
 *
 * @param request GetTempFileDownloadLinkRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTempFileDownloadLinkResponse
 */
async function getTempFileDownloadLinkWithOptions(request: GetTempFileDownloadLinkRequest, runtime: Util.RuntimeOptions): GetTempFileDownloadLinkResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.tempFileKey)) {
    query['TempFileKey'] = request.tempFileKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTempFileDownloadLink',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Obtains download links of files such as job reports.
 *
 * @param request GetTempFileDownloadLinkRequest
 * @return GetTempFileDownloadLinkResponse
 */
async function getTempFileDownloadLink(request: GetTempFileDownloadLinkRequest): GetTempFileDownloadLinkResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTempFileDownloadLinkWithOptions(request, runtime);
}

model InstallBackupClientsRequest {
  crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the RAM role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='BackupRole'),
  crossAccountType?: string(name='CrossAccountType', description='Specifies whether data is backed up within the same Alibaba Cloud account or across Alibaba Cloud accounts. Valid values:

*   SELF_ACCOUNT: Data is backed up within the same Alibaba Cloud account.
*   CROSS_ACCOUNT: Data is backed up across Alibaba Cloud accounts.', example='CROSS_ACCOUNT'),
  crossAccountUserId?: long(name='CrossAccountUserId', description='The ID of the source Alibaba Cloud account that authorizes the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='16392782xxxxxx'),
  instanceIds?: map[string]any(name='InstanceIds', description='The IDs of the ECS instances. You can specify up to 20 IDs.

This parameter is required.', example='["i-0xi5wj5*****v3j3bh2gj5"]'),
}

model InstallBackupClientsShrinkRequest {
  crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the RAM role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='BackupRole'),
  crossAccountType?: string(name='CrossAccountType', description='Specifies whether data is backed up within the same Alibaba Cloud account or across Alibaba Cloud accounts. Valid values:

*   SELF_ACCOUNT: Data is backed up within the same Alibaba Cloud account.
*   CROSS_ACCOUNT: Data is backed up across Alibaba Cloud accounts.', example='CROSS_ACCOUNT'),
  crossAccountUserId?: long(name='CrossAccountUserId', description='The ID of the source Alibaba Cloud account that authorizes the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='16392782xxxxxx'),
  instanceIdsShrink?: string(name='InstanceIds', description='The IDs of the ECS instances. You can specify up to 20 IDs.

This parameter is required.', example='["i-0xi5wj5*****v3j3bh2gj5"]'),
}

model InstallBackupClientsResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  instanceStatuses?: [ 
    {
      errorCode?: string(name='ErrorCode', description='The error code that is returned. Valid values:

*   If the value is empty, the call is successful.
*   **InstanceNotExists**: The ECS instance does not exist.
*   **InstanceNotRunning**: The ECS instance is not running.
*   **CloudAssistNotRunningOnInstance**: Cloud Assistant is unavailable.', example='InstanceNotExists'),
      instanceId?: string(name='InstanceId', description='The ID of the ECS instance.', example='i-0xi5w***v3j3bh2gj5'),
      validInstance?: boolean(name='ValidInstance', description='Indicates whether an HBR client can be installed on the ECS instance. Valid values:

*   true: An HBR client can be installed on the ECS instance.
*   false: An HBR client cannot be installed on the ECS instance.', example='true'),
    }
  ](name='InstanceStatuses', description='The status of the ECS instance.'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
  taskId?: string(name='TaskId', description='The ID of the asynchronous job. You can call the DescribeTask operation to query the execution result of an asynchronous job.', example='t-*********************'),
}

model InstallBackupClientsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: InstallBackupClientsResponseBody(name='body'),
}

/**
 * @summary Installs an HBR client on one or more Elastic Compute Service (ECS) instances.
 *
 * @description *   This operation creates an asynchronous job at the backend and calls Cloud Assistant to install an HBR client on an ECS instance.
 * *   You can call the [DescribeTask](https://help.aliyun.com/document_detail/431265.html) operation to query the execution result of an asynchronous job.
 * *   The timeout period of an asynchronous job is 15 minutes. We recommend that you call the DescribeTask operation to run the first query 60 seconds after you call the InstallBackupClients operation to install HBR clients. Then, run the next queries at an interval of 30 seconds.
 *
 * @param tmpReq InstallBackupClientsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return InstallBackupClientsResponse
 */
async function installBackupClientsWithOptions(tmpReq: InstallBackupClientsRequest, runtime: Util.RuntimeOptions): InstallBackupClientsResponse {
  Util.validateModel(tmpReq);
  var request = new InstallBackupClientsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.instanceIds)) {
    request.instanceIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.instanceIds, 'InstanceIds', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.crossAccountRoleName)) {
    query['CrossAccountRoleName'] = request.crossAccountRoleName;
  }
  if (!Util.isUnset(request.crossAccountType)) {
    query['CrossAccountType'] = request.crossAccountType;
  }
  if (!Util.isUnset(request.crossAccountUserId)) {
    query['CrossAccountUserId'] = request.crossAccountUserId;
  }
  if (!Util.isUnset(request.instanceIdsShrink)) {
    query['InstanceIds'] = request.instanceIdsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'InstallBackupClients',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Installs an HBR client on one or more Elastic Compute Service (ECS) instances.
 *
 * @description *   This operation creates an asynchronous job at the backend and calls Cloud Assistant to install an HBR client on an ECS instance.
 * *   You can call the [DescribeTask](https://help.aliyun.com/document_detail/431265.html) operation to query the execution result of an asynchronous job.
 * *   The timeout period of an asynchronous job is 15 minutes. We recommend that you call the DescribeTask operation to run the first query 60 seconds after you call the InstallBackupClients operation to install HBR clients. Then, run the next queries at an interval of 30 seconds.
 *
 * @param request InstallBackupClientsRequest
 * @return InstallBackupClientsResponse
 */
async function installBackupClients(request: InstallBackupClientsRequest): InstallBackupClientsResponse {
  var runtime = new Util.RuntimeOptions{};
  return installBackupClientsWithOptions(request, runtime);
}

model OpenHbrServiceResponseBody = {
  orderId?: string(name='OrderId', description='The ID of the order.', example='215463686160696'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F4A1D5F4-5055-549A-8B25-6DD23311E299'),
}

model OpenHbrServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OpenHbrServiceResponseBody(name='body'),
}

/**
 * @summary Activates Cloud Backup.
 *
 * @param request OpenHbrServiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return OpenHbrServiceResponse
 */
async function openHbrServiceWithOptions(runtime: Util.RuntimeOptions): OpenHbrServiceResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'OpenHbrService',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Activates Cloud Backup.
 *
 * @return OpenHbrServiceResponse
 */
async function openHbrService(): OpenHbrServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return openHbrServiceWithOptions(runtime);
}

model SearchHistoricalSnapshotsRequest {
  limit?: int32(name='Limit', description='The maximum number of rows that you want the current query to return. To query only the number of matched rows without the need to return specific data, you can set the Limit parameter to `0`. Then, the operation returns only the number of matched rows.', example='10'),
  nextToken?: string(name='NextToken', description='The token that is required to obtain the next page of backup snapshots.', example='caeba0bbb2be03f84eb48b699f0a****'),
  order?: string(name='Order', description='The ordering mode. Valid values:

*   ASC (default): ascending order
*   DESC: descending order', example='ASC'),
  query?: [ any ](name='Query', description='The query conditions. Example:

    [
      {
        "field": "VaultId",
        "value": "v-0003rf9m*****qx5",
        "operation": "MATCH_TERM"
      },
      {
        "field": "InstanceId",
        "value": "i-bp1i20zq2*****e9368m",
        "operation": "MATCH_TERM"
      },
      {
        "field": "PlanId",
        "value": "plan-0005vk*****gkd1iu4f",
        "operation": "MATCH_TERM"
      },
      {
        "field": "CompleteTime",
        "value": "1626769913",
        "operation": "GREATER_THAN_OR_EQUAL"
      }
    ]

*   The following fields are supported:

    *   VaultId: specifies the ID of the backup vault. This field is required.
    *   InstanceId: specifies the ID of the Elastic Compute Service (ECS) instance. If the SourceType parameter is set to ECS_FILE, this field is required.
    *   Bucket: specifies the name of the Object Storage Service (OSS) bucket. If the SourceType parameter is set to OSS, this field is required.
    *   FileSystemId: specifies the ID of the File Storage NAS (NAS) file system. If the SourceType parameter is set to NAS, this field is required.
    *   CreateTime: specifies the time when the NAS file system was created. If the SourceType parameter is set to NAS, this field is required.
    *   CompleteTime: specifies the time when the backup snapshot was completed.
    *   PlanId: the ID of a backup plan.

*   The following operations are supported:

    *   MATCH_TERM: exact match.
    *   GREATER_THAN: greater than.
    *   GREATER_THAN_OR_EQUAL: greater than or equal to.
    *   LESS_THAN: less than.
    *   LESS_THAN_OR_EQUAL: less than or equal to.
    *   BETWEEN: specifies a JSON array as a range. The results must fall within the range in the `[Minimum value,Maximum value]` format.
    *   IN: specifies an array as a collection. The results must fall within the collection.
    *   NOT_IN: specifies an array as a collection. The results cannot fall within the collection.', example='[   {     "field": "VaultId",     "value": "v-0003rf9m17pap3ltpqx5",     "operation": "MATCH_TERM"   },   {     "field": "InstanceId",     "value": "i-bp1i20zq2wuzdie9368m",     "operation": "MATCH_TERM"   },   {     "field": "PlanId",     "value": "plan-0005vkqhpesqgkd1iu4f",     "operation": "MATCH_TERM"   },   {     "field": "CompleteTime",     "value": 1626769913,     "operation": "GREATER_THAN_OR_EQUAL"   } ]'),
  sortBy?: string(name='SortBy', description='The field that is used to sort data.', example='CreatedTime'),
  sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **ECS_FILE**: backup snapshots for Elastic Compute Service (ECS) files
*   **OSS**: backup snapshots for Object Storage Service (OSS) buckets
*   **NAS**: backup snapshots for Apsara File Storage NAS file systems', example='ECS_FILE'),
}

model SearchHistoricalSnapshotsShrinkRequest {
  limit?: int32(name='Limit', description='The maximum number of rows that you want the current query to return. To query only the number of matched rows without the need to return specific data, you can set the Limit parameter to `0`. Then, the operation returns only the number of matched rows.', example='10'),
  nextToken?: string(name='NextToken', description='The token that is required to obtain the next page of backup snapshots.', example='caeba0bbb2be03f84eb48b699f0a****'),
  order?: string(name='Order', description='The ordering mode. Valid values:

*   ASC (default): ascending order
*   DESC: descending order', example='ASC'),
  queryShrink?: string(name='Query', description='The query conditions. Example:

    [
      {
        "field": "VaultId",
        "value": "v-0003rf9m*****qx5",
        "operation": "MATCH_TERM"
      },
      {
        "field": "InstanceId",
        "value": "i-bp1i20zq2*****e9368m",
        "operation": "MATCH_TERM"
      },
      {
        "field": "PlanId",
        "value": "plan-0005vk*****gkd1iu4f",
        "operation": "MATCH_TERM"
      },
      {
        "field": "CompleteTime",
        "value": "1626769913",
        "operation": "GREATER_THAN_OR_EQUAL"
      }
    ]

*   The following fields are supported:

    *   VaultId: specifies the ID of the backup vault. This field is required.
    *   InstanceId: specifies the ID of the Elastic Compute Service (ECS) instance. If the SourceType parameter is set to ECS_FILE, this field is required.
    *   Bucket: specifies the name of the Object Storage Service (OSS) bucket. If the SourceType parameter is set to OSS, this field is required.
    *   FileSystemId: specifies the ID of the File Storage NAS (NAS) file system. If the SourceType parameter is set to NAS, this field is required.
    *   CreateTime: specifies the time when the NAS file system was created. If the SourceType parameter is set to NAS, this field is required.
    *   CompleteTime: specifies the time when the backup snapshot was completed.
    *   PlanId: the ID of a backup plan.

*   The following operations are supported:

    *   MATCH_TERM: exact match.
    *   GREATER_THAN: greater than.
    *   GREATER_THAN_OR_EQUAL: greater than or equal to.
    *   LESS_THAN: less than.
    *   LESS_THAN_OR_EQUAL: less than or equal to.
    *   BETWEEN: specifies a JSON array as a range. The results must fall within the range in the `[Minimum value,Maximum value]` format.
    *   IN: specifies an array as a collection. The results must fall within the collection.
    *   NOT_IN: specifies an array as a collection. The results cannot fall within the collection.', example='[   {     "field": "VaultId",     "value": "v-0003rf9m17pap3ltpqx5",     "operation": "MATCH_TERM"   },   {     "field": "InstanceId",     "value": "i-bp1i20zq2wuzdie9368m",     "operation": "MATCH_TERM"   },   {     "field": "PlanId",     "value": "plan-0005vkqhpesqgkd1iu4f",     "operation": "MATCH_TERM"   },   {     "field": "CompleteTime",     "value": 1626769913,     "operation": "GREATER_THAN_OR_EQUAL"   } ]'),
  sortBy?: string(name='SortBy', description='The field that is used to sort data.', example='CreatedTime'),
  sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **ECS_FILE**: backup snapshots for Elastic Compute Service (ECS) files
*   **OSS**: backup snapshots for Object Storage Service (OSS) buckets
*   **NAS**: backup snapshots for Apsara File Storage NAS file systems', example='ECS_FILE'),
}

model SearchHistoricalSnapshotsResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  limit?: int32(name='Limit', description='The number of historical backup snapshots that are displayed on the current page.', example='10'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  nextToken?: string(name='NextToken', description='The token that is required to obtain the next page of backup snapshots.', example='BE'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  snapshots?: {
    snapshot?: [ 
    {
      actualBytes?: long(name='ActualBytes', description='The actual data amount of backup snapshots after duplicates are removed. Unit: bytes.', example='600'),
      actualItems?: long(name='ActualItems', description='The actual number of backup snapshots.

>  This parameter is available only for file backup.', example='6'),
      archiveTime?: long(name='ArchiveTime', description='Time to archive', example='1640334062'),
      backupType?: string(name='BackupType', description='The backup type. Valid value: **COMPLETE**, which indicates full backup.', example='COMPLETE'),
      bucket?: string(name='Bucket', description='This parameter is returned only if the **SourceType** parameter is set to **OSS**. This parameter indicates the name of the OSS bucket.', example='hbr-backup-oss'),
      bytesDone?: long(name='BytesDone', description='The actual amount of data that is generated by incremental backups. Unit: bytes.', example='800'),
      bytesTotal?: long(name='BytesTotal', description='The total amount of data. Unit: bytes.', example='1000'),
      clientId?: string(name='ClientId', description='This parameter is returned only if the **SourceType** parameter is set to **ECS_FILE**. This parameter indicates the ID of the HBR client.', example='c-*********************'),
      completeTime?: long(name='CompleteTime', description='The time when the backup snapshot was completed. The value is a UNIX timestamp. Unit: seconds.', example='1554347313'),
      createTime?: long(name='CreateTime', description='This parameter is returned only if the **SourceType** parameter is set to **NAS**. This parameter indicates the time when the file system was created. The value is a UNIX timestamp. Unit: seconds.', example='1607436917'),
      createdTime?: long(name='CreatedTime', description='The time when the backup snapshot was created. The value is a UNIX timestamp. Unit: seconds.', example='1554347313'),
      errorFile?: string(name='ErrorFile', description='The files that record the information about backup failures, including the information about partially completed backups.', example='Item	Error Message C:\\\\Program Files (x86)\\\\Symantec\\\\Symantec Endpoint Protection\\\\14.3.558.0000.105\\\\Bin\\\\service.dat	Open: open \\\\\\\\?\\\\C:\\\\Program Files (x86)\\\\Symantec\\\\Symantec Endpoint Protection\\\\14.3.558.0000.105\\\\Bin\\\\service.dat: The process cannot access the file because it is being used by another process. C:\\\\ProgramData\\\\McAfee\\\\Agent\\\\data\\\\InstallerFiles\\\\172e8a3b04b7ab0fd0215f4fb7707e3744b37d83b6743b3eacb94447c74dc9af_contrib.ini	Open: open \\\\\\\\?\\\\C:\\\\ProgramData\\\\McAfee\\\\Agent\\\\data\\\\InstallerFiles\\\\172e8a3b04b7ab0fd0215f4fb7707e3744b37d83b6743b3eacb94447c74dc9af_contrib.ini: Access is denied.'),
      exclude?: string(name='Exclude', description='Backup paths not included in the backup job.', example='[\\\\"/test/example_cn-hangzhou_7.txt\\\\", \\\\"/test/example_cn-hangzhou_1.txt\\\\", \\\\"/test/example_cn-hangzhou_3.txt\\\\", \\\\"/test/example_cn-hangzhou_9.txt\\\\", \\\\"/test/example_cn-hangzhou_6.txt\\\\"]'),
      expireTime?: long(name='ExpireTime', description='The time when the snapshot expired. The value is a UNIX timestamp. Unit: seconds.', example='1640334062'),
      fileSystemId?: string(name='FileSystemId', description='This parameter is returned only if the **SourceType** parameter is set to **NAS**. This parameter indicates the ID of the NAS file system.', example='005494'),
      include?: string(name='Include', description='Backup paths included in the backup job.', example='[\\\\"/test/example_cn-huhehaote_3.txt\\\\", \\\\"/test/example_cn-huhehaote_9.txt\\\\", \\\\"/test/example_cn-huhehaote_5.txt\\\\", \\\\"/test/example_cn-huhehaote_1.txt\\\\", \\\\"/test/example_cn-huhehaote_7.txt\\\\"]'),
      instanceId?: string(name='InstanceId', description='This parameter is valid only if the **SourceType** parameter is set to **ECS_FILE**. This parameter indicates the ID of the ECS instance.', example='i-*********************'),
      instanceName?: string(name='InstanceName', description='The name of the Tablestore instance.', example='instancename'),
      itemsDone?: long(name='ItemsDone', description='The number of objects that are backed up.

>  This parameter is available only for file backup.', example='8'),
      itemsTotal?: long(name='ItemsTotal', description='The total number of objects in the data source.

>  This parameter is available only for file backup.', example='10'),
      jobId?: string(name='JobId', description='The ID of the backup job.', example='v-*********************'),
      parentSnapshotHash?: string(name='ParentSnapshotHash', description='The hash value of the parent backup snapshot.', example='f2fe..'),
      path?: string(name='Path', description='This parameter is returned only if the **SourceType** parameter is set to **ECS_FILE**. This parameter indicates the path to the files that are backed up.', example='["/home"]'),
      paths?: {
        path?: [ string ](name='Path')
      }(name='Paths', description='The source paths.', example='"/home"'),
      prefix?: string(name='Prefix', description='This parameter is returned only if the **SourceType** parameter is set to **OSS**. This parameter indicates the prefix of objects that are backed up.', example='example/'),
      rangeEnd?: long(name='RangeEnd', description='The time when the backup job ended. The value is a UNIX timestamp. Unit: milliseconds.', example='1642521709966'),
      rangeStart?: long(name='RangeStart', description='The time when the backup job started. The value is a UNIX timestamp. Unit: milliseconds.', example='1642492553038'),
      retention?: long(name='Retention', description='The retention period of the backup snapshot. Unit: days.', example='7'),
      snapshotHash?: string(name='SnapshotHash', description='The hash value of the backup snapshot.', example='f2fe...'),
      snapshotId?: string(name='SnapshotId', description='The ID of the backup snapshot.', example='s-*********************'),
      sourceParentSnapshotHash?: string(name='SourceParentSnapshotHash', description='Parent snapshot HASH value before archiving.', example='qwer***'),
      sourceSnapshotHash?: string(name='SourceSnapshotHash', description='Snapshot HASH value before archiving', example='qwer***'),
      sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **ECS_FILE**: backup snapshots for ECS files
*   **OSS**: backup snapshots for OSS buckets
*   **NAS**: backup snapshots for NAS file systems', example='ECS_FILE'),
      startTime?: long(name='StartTime', description='The time when the backup snapshot started. The value is a UNIX timestamp. Unit: seconds.', example='1554347313'),
      status?: string(name='Status', description='The status of the backup job. Valid values:

*   **COMPLETE**: The backup job is completed.
*   **PARTIAL_COMPLETE**: The backup job is partially completed.
*   **FAILED**: The backup job has failed.', example='COMPLETE'),
      storageClass?: string(name='StorageClass', description='Storage type. Values: 
- **Standard**: Standard. 
- **Archive**: Archive. 
- **ColdArchive**: Cold Archive.', example='STANDARD'),
      tableName?: string(name='TableName', description='The name of a table in the Tablestore instance.', example='table2'),
      updatedTime?: long(name='UpdatedTime', description='The time when the backup snapshot was updated. The value is a UNIX timestamp. Unit: seconds.', example='1554347313'),
      useCommonNas?: boolean(name='UseCommonNas', description='Whether to use local NAS.', example='false'),
      vaultId?: string(name='VaultId', description='The ID of the backup vault that stores the backup snapshot.', example='v-0003rf9m17pap3ltpqx5'),
    }
  ](name='Snapshot')
  }(name='Snapshots', description='The historical backup snapshots.'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
  totalCount?: int32(name='TotalCount', description='The total number of returned backup snapshots that meet the specified conditions.', example='20'),
}

model SearchHistoricalSnapshotsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SearchHistoricalSnapshotsResponseBody(name='body'),
}

/**
 * @summary Queries the information about one or more backup snapshots that meet the specified conditions.
 *
 * @param tmpReq SearchHistoricalSnapshotsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SearchHistoricalSnapshotsResponse
 */
async function searchHistoricalSnapshotsWithOptions(tmpReq: SearchHistoricalSnapshotsRequest, runtime: Util.RuntimeOptions): SearchHistoricalSnapshotsResponse {
  Util.validateModel(tmpReq);
  var request = new SearchHistoricalSnapshotsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.query)) {
    request.queryShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.query, 'Query', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.queryShrink)) {
    query['Query'] = request.queryShrink;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SearchHistoricalSnapshots',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the information about one or more backup snapshots that meet the specified conditions.
 *
 * @param request SearchHistoricalSnapshotsRequest
 * @return SearchHistoricalSnapshotsResponse
 */
async function searchHistoricalSnapshots(request: SearchHistoricalSnapshotsRequest): SearchHistoricalSnapshotsResponse {
  var runtime = new Util.RuntimeOptions{};
  return searchHistoricalSnapshotsWithOptions(request, runtime);
}

model StartHanaDatabaseAsyncRequest {
  clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance.

This parameter is required.', example='cl-000a9ipe******sme'),
  databaseName?: string(name='DatabaseName', description='The database name.

This parameter is required.', example='HXE'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.

This parameter is required.', example='v-0000hrh******vhr3i'),
}

model StartHanaDatabaseAsyncResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  taskId?: string(name='TaskId', description='The ID of the job that is used to initialize the backup vault. You can call the DescribeTask operation to query the job status.', example='t-000bjt479yefheij1o0x'),
}

model StartHanaDatabaseAsyncResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartHanaDatabaseAsyncResponseBody(name='body'),
}

/**
 * @summary Starts an SAP HANA database.
 *
 * @description To stop the database again, call the StopHanaDatabaseAsync operation.
 *
 * @param request StartHanaDatabaseAsyncRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartHanaDatabaseAsyncResponse
 */
async function startHanaDatabaseAsyncWithOptions(request: StartHanaDatabaseAsyncRequest, runtime: Util.RuntimeOptions): StartHanaDatabaseAsyncResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.databaseName)) {
    query['DatabaseName'] = request.databaseName;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartHanaDatabaseAsync',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Starts an SAP HANA database.
 *
 * @description To stop the database again, call the StopHanaDatabaseAsync operation.
 *
 * @param request StartHanaDatabaseAsyncRequest
 * @return StartHanaDatabaseAsyncResponse
 */
async function startHanaDatabaseAsync(request: StartHanaDatabaseAsyncRequest): StartHanaDatabaseAsyncResponse {
  var runtime = new Util.RuntimeOptions{};
  return startHanaDatabaseAsyncWithOptions(request, runtime);
}

model StopHanaDatabaseAsyncRequest {
  clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance.

This parameter is required.', example='cl-000dw******45ijer'),
  databaseName?: string(name='DatabaseName', description='The database name.

This parameter is required.', example='BWP'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.

This parameter is required.', example='v-0006wkn******gzkn'),
}

model StopHanaDatabaseAsyncResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='CD8B903B-DE8F-5969-9414-B2C634D504D9'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  taskId?: string(name='TaskId', description='The ID of the asynchronous job. You can call the DescribeTask operation to query the execution result of an asynchronous job.', example='t-0007o3vqfukgd3y5bxxr'),
}

model StopHanaDatabaseAsyncResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopHanaDatabaseAsyncResponseBody(name='body'),
}

/**
 * @summary Stops an SAP HANA database.
 *
 * @description To start the database again, call the StartHanaDatabaseAsync operation.
 *
 * @param request StopHanaDatabaseAsyncRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopHanaDatabaseAsyncResponse
 */
async function stopHanaDatabaseAsyncWithOptions(request: StopHanaDatabaseAsyncRequest, runtime: Util.RuntimeOptions): StopHanaDatabaseAsyncResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.databaseName)) {
    query['DatabaseName'] = request.databaseName;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StopHanaDatabaseAsync',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Stops an SAP HANA database.
 *
 * @description To start the database again, call the StartHanaDatabaseAsync operation.
 *
 * @param request StopHanaDatabaseAsyncRequest
 * @return StopHanaDatabaseAsyncResponse
 */
async function stopHanaDatabaseAsync(request: StopHanaDatabaseAsyncRequest): StopHanaDatabaseAsyncResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopHanaDatabaseAsyncWithOptions(request, runtime);
}

model UninstallBackupClientsRequest {
  clientIds?: map[string]any(name='ClientIds', description='The IDs of Cloud Backup clients. The sum of the number of Cloud Backup client IDs and the number of ECS instance IDs cannot exceed 20. Otherwise, an error occurs.', example='["c-*********************"]'),
  crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the RAM role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up and restore data across Alibaba Cloud accounts.', example='BackupRole'),
  crossAccountType?: string(name='CrossAccountType', description='Specifies whether data is backed up and restored within the same Alibaba Cloud account or across Alibaba Cloud accounts. Valid values:

*   SELF_ACCOUNT: Data is backed up and restored within the same Alibaba Cloud account.
*   CROSS_ACCOUNT: Data is backed up and restored across Alibaba Cloud accounts.', example='CROSS_ACCOUNT'),
  crossAccountUserId?: long(name='CrossAccountUserId', description='The ID of the source Alibaba Cloud account that authorizes the current Alibaba Cloud account to back up and restore data across Alibaba Cloud accounts.', example='129349237xxxxx'),
  instanceIds?: map[string]any(name='InstanceIds', description='The IDs of Elastic Compute Service (ECS) instances. You can specify a maximum of 20 ECS instances.', example='["i-0xi5wj5*****v3j3bh2gj5"]'),
}

model UninstallBackupClientsShrinkRequest {
  clientIdsShrink?: string(name='ClientIds', description='The IDs of Cloud Backup clients. The sum of the number of Cloud Backup client IDs and the number of ECS instance IDs cannot exceed 20. Otherwise, an error occurs.', example='["c-*********************"]'),
  crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the RAM role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up and restore data across Alibaba Cloud accounts.', example='BackupRole'),
  crossAccountType?: string(name='CrossAccountType', description='Specifies whether data is backed up and restored within the same Alibaba Cloud account or across Alibaba Cloud accounts. Valid values:

*   SELF_ACCOUNT: Data is backed up and restored within the same Alibaba Cloud account.
*   CROSS_ACCOUNT: Data is backed up and restored across Alibaba Cloud accounts.', example='CROSS_ACCOUNT'),
  crossAccountUserId?: long(name='CrossAccountUserId', description='The ID of the source Alibaba Cloud account that authorizes the current Alibaba Cloud account to back up and restore data across Alibaba Cloud accounts.', example='129349237xxxxx'),
  instanceIdsShrink?: string(name='InstanceIds', description='The IDs of Elastic Compute Service (ECS) instances. You can specify a maximum of 20 ECS instances.', example='["i-0xi5wj5*****v3j3bh2gj5"]'),
}

model UninstallBackupClientsResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the request is successful.', example='200'),
  instanceStatuses?: [ 
    {
      errorCode?: string(name='ErrorCode', description='The error code. Valid values:

*   If the value is empty, the request is successful.
*   **InstanceNotExists**: The ECS instance does not exist.
*   **InstanceNotRunning**: The ECS instance is not running.
*   **CloudAssistNotRunningOnInstance**: Cloud Assistant is unavailable.', example='InstanceNotExists'),
      instanceId?: string(name='InstanceId', description='The ID of the ECS instance.', example='i-0xi5w***v3j3bh2gj5'),
      validInstance?: boolean(name='ValidInstance', description='Indicates whether a backup client can be installed on the ECS instance.

*   true: A backup client can be installed on the ECS instance.
*   false: A backup client cannot be installed on the ECS instance.', example='true'),
    }
  ](name='InstanceStatuses', description='The status of the ECS instance.'),
  message?: string(name='Message', description='The message that is returned. If the request is successful, a value of successful is returned. If the request fails, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the request is successful.

*   true: The request is successful.
*   false: The request fails.', example='true'),
  taskId?: string(name='TaskId', description='The ID of the asynchronous job. You can call the DescribeTask operation to query the execution result of the asynchronous job.', example='t-*********************'),
}

model UninstallBackupClientsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UninstallBackupClientsResponseBody(name='body'),
}

/**
 * @summary Uninstalls a Cloud Backup client from one or more Elastic Compute Service (ECS) instance.
 *
 * @description *   This operation creates an asynchronous job at the backend and calls Cloud Assistant to uninstall a backup client from an ECS instance.
 * *   You can call the DescribeTask operation to query the execution result of an asynchronous job.
 * *   The timeout period of an asynchronous job is 15 minutes. We recommend that you call the DescribeTask operation to run the first query 30 seconds after you call the UninstallBackupClients operation to uninstall backup clients. Then, run the next queries at an interval of 30 seconds.
 *
 * @param tmpReq UninstallBackupClientsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UninstallBackupClientsResponse
 */
async function uninstallBackupClientsWithOptions(tmpReq: UninstallBackupClientsRequest, runtime: Util.RuntimeOptions): UninstallBackupClientsResponse {
  Util.validateModel(tmpReq);
  var request = new UninstallBackupClientsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.clientIds)) {
    request.clientIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.clientIds, 'ClientIds', 'json');
  }
  if (!Util.isUnset(tmpReq.instanceIds)) {
    request.instanceIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.instanceIds, 'InstanceIds', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.clientIdsShrink)) {
    query['ClientIds'] = request.clientIdsShrink;
  }
  if (!Util.isUnset(request.crossAccountRoleName)) {
    query['CrossAccountRoleName'] = request.crossAccountRoleName;
  }
  if (!Util.isUnset(request.crossAccountType)) {
    query['CrossAccountType'] = request.crossAccountType;
  }
  if (!Util.isUnset(request.crossAccountUserId)) {
    query['CrossAccountUserId'] = request.crossAccountUserId;
  }
  if (!Util.isUnset(request.instanceIdsShrink)) {
    query['InstanceIds'] = request.instanceIdsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UninstallBackupClients',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Uninstalls a Cloud Backup client from one or more Elastic Compute Service (ECS) instance.
 *
 * @description *   This operation creates an asynchronous job at the backend and calls Cloud Assistant to uninstall a backup client from an ECS instance.
 * *   You can call the DescribeTask operation to query the execution result of an asynchronous job.
 * *   The timeout period of an asynchronous job is 15 minutes. We recommend that you call the DescribeTask operation to run the first query 30 seconds after you call the UninstallBackupClients operation to uninstall backup clients. Then, run the next queries at an interval of 30 seconds.
 *
 * @param request UninstallBackupClientsRequest
 * @return UninstallBackupClientsResponse
 */
async function uninstallBackupClients(request: UninstallBackupClientsRequest): UninstallBackupClientsResponse {
  var runtime = new Util.RuntimeOptions{};
  return uninstallBackupClientsWithOptions(request, runtime);
}

model UninstallClientRequest {
  clientId?: string(name='ClientId', description='The ID of the HBR client.

This parameter is required.', example='c-000iuqo******zi3rn'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfm3erpwweavki'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-0008n2q******ax3'),
}

model UninstallClientResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='048A2164-3732-5DF5-88B5-F97FA56DAEB1'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
  taskId?: string(name='TaskId', description='The ID of the asynchronous job. You can call the DescribeTask operation to query the execution result of an asynchronous job.', example='t-0009qs5qcnvuvqrl2mxl'),
}

model UninstallClientResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UninstallClientResponseBody(name='body'),
}

/**
 * @summary Uninstalls an HBR client.
 *
 * @description If you call this operation, the specified HBR client is uninstalled. To reinstall the HBR client, call the CreateClients operation.
 *
 * @param request UninstallClientRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UninstallClientResponse
 */
async function uninstallClientWithOptions(request: UninstallClientRequest, runtime: Util.RuntimeOptions): UninstallClientResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientId)) {
    query['ClientId'] = request.clientId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UninstallClient',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Uninstalls an HBR client.
 *
 * @description If you call this operation, the specified HBR client is uninstalled. To reinstall the HBR client, call the CreateClients operation.
 *
 * @param request UninstallClientRequest
 * @return UninstallClientResponse
 */
async function uninstallClient(request: UninstallClientRequest): UninstallClientResponse {
  var runtime = new Util.RuntimeOptions{};
  return uninstallClientWithOptions(request, runtime);
}

model UpdateBackupPlanRequest {
  changeListPath?: string(name='ChangeListPath', description='The configurations of the incremental file synchronization. This parameter is required for data synchronization only.', example='{"dataSourceId": "ds-123456789", "path": "/changelist"}'),
  detail?: map[string]any(name='Detail', description='The details about ECS instance backup. The value is a JSON string.

*   snapshotGroup: specifies whether to use a snapshot-consistent group. This parameter is valid only if all disks of the ECS instance are enhanced SSDs (ESSDs).
*   appConsistent: specifies whether to enable application consistency. If you set this parameter to true, you must also specify the preScriptPath and postScriptPath parameters.
*   preScriptPath: the path to the pre-freeze scripts.
*   postScriptPath: the path to the post-thaw scripts.', example='{\\\\"EnableFsFreeze\\\\":true,\\\\"appConsistent\\\\":false,\\\\"postScriptPath\\\\":\\\\"\\\\",\\\\"preScriptPath\\\\":\\\\"\\\\",\\\\"snapshotGroup\\\\":true,\\\\"timeoutInSeconds\\\\":60}'),
  exclude?: string(name='Exclude', description='This parameter is required only if the **SourceType** parameter is set to **ECS_FILE**. This parameter specifies the paths to the files that are excluded from the backup job. The value must be 1 to 255 characters in length.', example='["/var", "/proc"]'),
  include?: string(name='Include', description='This parameter is required only if the **SourceType** parameter is set to **ECS_FILE**. This parameter specifies the paths to the files that you want to back up. The value must be 1 to 255 characters in length.', example='["/home/alice/*.pdf", "/home/bob/*.txt"]'),
  keepLatestSnapshots?: long(name='KeepLatestSnapshots', description='Specifies whether to enable the feature of keeping at least one backup version. Valid values:

*   0: The feature is disabled.
*   1: The feature is enabled.', example='1'),
  options?: string(name='Options', description='This parameter is required only if the **SourceType** parameter is set to **ECS_FILE**. This parameter specifies whether to use Windows Volume Shadow Copy Service (VSS) to define a source path.

*   This parameter is available only for Windows ECS instances.
*   If data changes occur in the backup source, the source data must be the same as the data to be backed up before you can set this parameter to `["UseVSS":true]`.
*   If you use VSS, you cannot back up data from multiple directories.', example='{"UseVSS":false}'),
  otsDetail?: OtsDetail(name='OtsDetail', description='The details about the Tablestore instance.'),
  path?: [ string ](name='Path', description='The source paths.'),
  planId?: string(name='PlanId', description='The ID of the backup plan.

This parameter is required.', example='plan-20211***735'),
  planName?: string(name='PlanName', description='The name of the backup plan.', example='planname'),
  prefix?: string(name='Prefix', description='This parameter is required only if the **SourceType** parameter is set to **OSS**. This parameter specifies the prefix of objects that you want to back up. After a prefix is specified, only objects whose names start with the prefix are backed up.', example='oss-prefix'),
  retention?: long(name='Retention', description='The retention period of the backup data. Minimum value: 1. Unit: days.', example='7'),
  rule?: [ 
    {
      backupType?: string(name='BackupType', description='The backup type. Valid value: **COMPLETE**, which indicates full backup.', example='COMPLETE'),
      destinationRegionId?: string(name='DestinationRegionId', description='The ID of the region where the remote backup vault resides.', example='cn-shanghai'),
      destinationRetention?: long(name='DestinationRetention', description='The retention period of the backup data. Unit: days.', example='7'),
      disabled?: boolean(name='Disabled', description='Specifies whether to disable the policy.', example='false'),
      doCopy?: boolean(name='DoCopy', description='Specifies whether to enable remote replication.', example='false'),
      retention?: long(name='Retention', description='The retention period of the backup data. Minimum value: 1. Unit: days.', example='7'),
      ruleName?: string(name='RuleName', description='The name of the backup policy.', example='rule-test-name'),
      schedule?: string(name='Schedule', description='The backup policy. Format: I|{startTime}|{interval}. The system runs the first backup job at a point in time that is specified in the {startTime} parameter and the subsequent backup jobs at an interval that is specified in the {interval} parameter. The system does not run a backup job before the specified point in time. Each backup job, except the first one, starts only after the previous backup job is completed. For example, I|1631685600|P1D specifies that the system runs the first backup job at 14:00:00 on September 15, 2021 and the subsequent backup jobs once a day.

startTime: the time at which the system starts to run a backup job. The time must follow the UNIX time format. Unit: seconds. interval: the interval at which the system runs a backup job. The interval must follow the ISO 8601 standard. For example, PT1H specifies an interval of one hour. P1D specifies an interval of one day.', example='I|1631685600|P1D'),
    }
  ](name='Rule', description='The rule of the backup plan.'),
  schedule?: string(name='Schedule', description='The backup policy. Format: `I|{startTime}|{interval}`. The system runs the first backup job at a point in time that is specified in the `{startTime}` parameter and the subsequent backup jobs at an interval that is specified in the `{interval}` parameter. The system does not run a backup job before the specified point in time. Each backup job, except the first one, starts only after the previous backup job is completed. For example, `I|1631685600|P1D` specifies that the system runs the first backup job at 14:00:00 on September 15, 2021 and the subsequent backup jobs once a day.

*   **startTime**: the time at which the system starts to run a backup job. The time must follow the UNIX time format. Unit: seconds.
*   **interval**: the interval at which the system runs a backup job. The interval must follow the ISO 8601 standard. For example, PT1H specifies an interval of one hour. P1D specifies an interval of one day.', example='I|1602673264|P1D'),
  sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **ECS_FILE**: Elastic Compute Service (ECS) files
*   **OSS**: Object Storage Service (OSS) buckets
*   **NAS**: Apsara File Storage NAS file systems
*   **OTS**: Tablestore instances
*   **UDM_ECS**: ECS instances', example='ECS_FILE'),
  speedLimit?: string(name='SpeedLimit', description='This parameter is required only if the **SourceType** parameter is set to **ECS_FILE**. This parameter specifies the throttling rules. To ensure business continuity, you can limit the bandwidth that is used for file backup during peak hours. Format: `{start}|{end}|{bandwidth}`. Separate multiple throttling rules with vertical bars (|). A specified time range cannot overlap with another time range.

*   **start**: the start hour
*   **end**: the end hour.
*   **bandwidth**: the bandwidth. Unit: KB/s.', example='0:24:5120'),
  updatePaths?: boolean(name='UpdatePaths', description='Specifies whether to update the source path if the backup source is empty. Valid values:

*   true: The system replaces the original source path with the specified source path.
*   false: The system does not update the original source path. The system backs up data based on the source path that you specified when you created the backup plan.', example='false'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-0006******q'),
}

model UpdateBackupPlanShrinkRequest {
  changeListPath?: string(name='ChangeListPath', description='The configurations of the incremental file synchronization. This parameter is required for data synchronization only.', example='{"dataSourceId": "ds-123456789", "path": "/changelist"}'),
  detailShrink?: string(name='Detail', description='The details about ECS instance backup. The value is a JSON string.

*   snapshotGroup: specifies whether to use a snapshot-consistent group. This parameter is valid only if all disks of the ECS instance are enhanced SSDs (ESSDs).
*   appConsistent: specifies whether to enable application consistency. If you set this parameter to true, you must also specify the preScriptPath and postScriptPath parameters.
*   preScriptPath: the path to the pre-freeze scripts.
*   postScriptPath: the path to the post-thaw scripts.', example='{\\\\"EnableFsFreeze\\\\":true,\\\\"appConsistent\\\\":false,\\\\"postScriptPath\\\\":\\\\"\\\\",\\\\"preScriptPath\\\\":\\\\"\\\\",\\\\"snapshotGroup\\\\":true,\\\\"timeoutInSeconds\\\\":60}'),
  exclude?: string(name='Exclude', description='This parameter is required only if the **SourceType** parameter is set to **ECS_FILE**. This parameter specifies the paths to the files that are excluded from the backup job. The value must be 1 to 255 characters in length.', example='["/var", "/proc"]'),
  include?: string(name='Include', description='This parameter is required only if the **SourceType** parameter is set to **ECS_FILE**. This parameter specifies the paths to the files that you want to back up. The value must be 1 to 255 characters in length.', example='["/home/alice/*.pdf", "/home/bob/*.txt"]'),
  keepLatestSnapshots?: long(name='KeepLatestSnapshots', description='Specifies whether to enable the feature of keeping at least one backup version. Valid values:

*   0: The feature is disabled.
*   1: The feature is enabled.', example='1'),
  options?: string(name='Options', description='This parameter is required only if the **SourceType** parameter is set to **ECS_FILE**. This parameter specifies whether to use Windows Volume Shadow Copy Service (VSS) to define a source path.

*   This parameter is available only for Windows ECS instances.
*   If data changes occur in the backup source, the source data must be the same as the data to be backed up before you can set this parameter to `["UseVSS":true]`.
*   If you use VSS, you cannot back up data from multiple directories.', example='{"UseVSS":false}'),
  otsDetailShrink?: string(name='OtsDetail', description='The details about the Tablestore instance.'),
  path?: [ string ](name='Path', description='The source paths.'),
  planId?: string(name='PlanId', description='The ID of the backup plan.

This parameter is required.', example='plan-20211***735'),
  planName?: string(name='PlanName', description='The name of the backup plan.', example='planname'),
  prefix?: string(name='Prefix', description='This parameter is required only if the **SourceType** parameter is set to **OSS**. This parameter specifies the prefix of objects that you want to back up. After a prefix is specified, only objects whose names start with the prefix are backed up.', example='oss-prefix'),
  retention?: long(name='Retention', description='The retention period of the backup data. Minimum value: 1. Unit: days.', example='7'),
  rule?: [ 
    {
      backupType?: string(name='BackupType', description='The backup type. Valid value: **COMPLETE**, which indicates full backup.', example='COMPLETE'),
      destinationRegionId?: string(name='DestinationRegionId', description='The ID of the region where the remote backup vault resides.', example='cn-shanghai'),
      destinationRetention?: long(name='DestinationRetention', description='The retention period of the backup data. Unit: days.', example='7'),
      disabled?: boolean(name='Disabled', description='Specifies whether to disable the policy.', example='false'),
      doCopy?: boolean(name='DoCopy', description='Specifies whether to enable remote replication.', example='false'),
      retention?: long(name='Retention', description='The retention period of the backup data. Minimum value: 1. Unit: days.', example='7'),
      ruleName?: string(name='RuleName', description='The name of the backup policy.', example='rule-test-name'),
      schedule?: string(name='Schedule', description='The backup policy. Format: I|{startTime}|{interval}. The system runs the first backup job at a point in time that is specified in the {startTime} parameter and the subsequent backup jobs at an interval that is specified in the {interval} parameter. The system does not run a backup job before the specified point in time. Each backup job, except the first one, starts only after the previous backup job is completed. For example, I|1631685600|P1D specifies that the system runs the first backup job at 14:00:00 on September 15, 2021 and the subsequent backup jobs once a day.

startTime: the time at which the system starts to run a backup job. The time must follow the UNIX time format. Unit: seconds. interval: the interval at which the system runs a backup job. The interval must follow the ISO 8601 standard. For example, PT1H specifies an interval of one hour. P1D specifies an interval of one day.', example='I|1631685600|P1D'),
    }
  ](name='Rule', description='The rule of the backup plan.'),
  schedule?: string(name='Schedule', description='The backup policy. Format: `I|{startTime}|{interval}`. The system runs the first backup job at a point in time that is specified in the `{startTime}` parameter and the subsequent backup jobs at an interval that is specified in the `{interval}` parameter. The system does not run a backup job before the specified point in time. Each backup job, except the first one, starts only after the previous backup job is completed. For example, `I|1631685600|P1D` specifies that the system runs the first backup job at 14:00:00 on September 15, 2021 and the subsequent backup jobs once a day.

*   **startTime**: the time at which the system starts to run a backup job. The time must follow the UNIX time format. Unit: seconds.
*   **interval**: the interval at which the system runs a backup job. The interval must follow the ISO 8601 standard. For example, PT1H specifies an interval of one hour. P1D specifies an interval of one day.', example='I|1602673264|P1D'),
  sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **ECS_FILE**: Elastic Compute Service (ECS) files
*   **OSS**: Object Storage Service (OSS) buckets
*   **NAS**: Apsara File Storage NAS file systems
*   **OTS**: Tablestore instances
*   **UDM_ECS**: ECS instances', example='ECS_FILE'),
  speedLimit?: string(name='SpeedLimit', description='This parameter is required only if the **SourceType** parameter is set to **ECS_FILE**. This parameter specifies the throttling rules. To ensure business continuity, you can limit the bandwidth that is used for file backup during peak hours. Format: `{start}|{end}|{bandwidth}`. Separate multiple throttling rules with vertical bars (|). A specified time range cannot overlap with another time range.

*   **start**: the start hour
*   **end**: the end hour.
*   **bandwidth**: the bandwidth. Unit: KB/s.', example='0:24:5120'),
  updatePaths?: boolean(name='UpdatePaths', description='Specifies whether to update the source path if the backup source is empty. Valid values:

*   true: The system replaces the original source path with the specified source path.
*   false: The system does not update the original source path. The system backs up data based on the source path that you specified when you created the backup plan.', example='false'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-0006******q'),
}

model UpdateBackupPlanResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
}

model UpdateBackupPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateBackupPlanResponseBody(name='body'),
}

/**
 * @summary Updates a backup plan.
 *
 * @param tmpReq UpdateBackupPlanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateBackupPlanResponse
 */
async function updateBackupPlanWithOptions(tmpReq: UpdateBackupPlanRequest, runtime: Util.RuntimeOptions): UpdateBackupPlanResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateBackupPlanShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.detail)) {
    request.detailShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.detail, 'Detail', 'json');
  }
  if (!Util.isUnset(tmpReq.otsDetail)) {
    request.otsDetailShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.otsDetail, 'OtsDetail', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.changeListPath)) {
    query['ChangeListPath'] = request.changeListPath;
  }
  if (!Util.isUnset(request.detailShrink)) {
    query['Detail'] = request.detailShrink;
  }
  if (!Util.isUnset(request.keepLatestSnapshots)) {
    query['KeepLatestSnapshots'] = request.keepLatestSnapshots;
  }
  if (!Util.isUnset(request.path)) {
    query['Path'] = request.path;
  }
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  if (!Util.isUnset(request.planName)) {
    query['PlanName'] = request.planName;
  }
  if (!Util.isUnset(request.prefix)) {
    query['Prefix'] = request.prefix;
  }
  if (!Util.isUnset(request.retention)) {
    query['Retention'] = request.retention;
  }
  if (!Util.isUnset(request.schedule)) {
    query['Schedule'] = request.schedule;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  if (!Util.isUnset(request.speedLimit)) {
    query['SpeedLimit'] = request.speedLimit;
  }
  if (!Util.isUnset(request.updatePaths)) {
    query['UpdatePaths'] = request.updatePaths;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.exclude)) {
    body['Exclude'] = request.exclude;
  }
  if (!Util.isUnset(request.include)) {
    body['Include'] = request.include;
  }
  if (!Util.isUnset(request.options)) {
    body['Options'] = request.options;
  }
  if (!Util.isUnset(request.otsDetailShrink)) {
    body['OtsDetail'] = request.otsDetailShrink;
  }
  if (!Util.isUnset(request.rule)) {
    body['Rule'] = request.rule;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateBackupPlan',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates a backup plan.
 *
 * @param request UpdateBackupPlanRequest
 * @return UpdateBackupPlanResponse
 */
async function updateBackupPlan(request: UpdateBackupPlanRequest): UpdateBackupPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateBackupPlanWithOptions(request, runtime);
}

model UpdateClientSettingsRequest {
  alertOnPartialComplete?: boolean(name='AlertOnPartialComplete', description='Specifies whether to generate alert for partially completed jobs. This parameter is valid only for on-premises file backup and ECS file backup.', example='false'),
  clientId?: string(name='ClientId', description='The ID of the HBR client.

This parameter is required.', example='c-*********************'),
  dataNetworkType?: string(name='DataNetworkType', description='The type of the endpoint on the data plane. Valid values:

*   **PUBLIC**: Internet
*   **VPC**: virtual private cloud (VPC)
*   **CLASSIC**: classic network', example='VPC'),
  dataProxySetting?: string(name='DataProxySetting', description='The proxy configuration on the data plane. Valid values:

*   **DISABLE**: The proxy is not used.
*   **USE_CONTROL_PROXY** (default): The configuration is the same as that on the control plane.
*   **CUSTOM**: The configuration is customized (HTTP).', example='USE_CONTROL_PROXY'),
  maxCpuCore?: int32(name='MaxCpuCore', description='The number of CPU cores used by a single backup job. The value 0 indicates that the number is unlimited.', example='1'),
  maxMemory?: long(name='MaxMemory', description='The maximum memory that can be used by the client. Unit: bytes. Only V2.13.0 and later are supported.', example='4096'),
  maxWorker?: int32(name='MaxWorker', description='The number of concurrent backup jobs. The value 0 indicates that the number is unlimited.', example='1'),
  proxyHost?: string(name='ProxyHost', description='The custom host IP address of the proxy server on the data plane.', example='192.168.11.100'),
  proxyPassword?: string(name='ProxyPassword', description='The custom password of the proxy server on the data plane.', example='******'),
  proxyPort?: int32(name='ProxyPort', description='The custom host port of the proxy server on the data plane.', example='3128'),
  proxyUser?: string(name='ProxyUser', description='The custom username of the proxy server on the data plane.', example='user'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-*********************'),
  useHttps?: boolean(name='UseHttps', description='Specifies whether to transmit the data on the data plane over HTTPS. Valid values:

*   true: Data is transmitted over HTTPS.
*   false: Data is transmitted over HTTP.', example='false'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault. This parameter is required for the old HBR client.', example='v-*********************'),
}

model UpdateClientSettingsResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model UpdateClientSettingsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateClientSettingsResponseBody(name='body'),
}

/**
 * @summary Updates the configurations of an HBR client.
 *
 * @description You can call this operation to update the configurations of both the old and new HBR clients.
 *
 * @param request UpdateClientSettingsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateClientSettingsResponse
 */
async function updateClientSettingsWithOptions(request: UpdateClientSettingsRequest, runtime: Util.RuntimeOptions): UpdateClientSettingsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.alertOnPartialComplete)) {
    query['AlertOnPartialComplete'] = request.alertOnPartialComplete;
  }
  if (!Util.isUnset(request.clientId)) {
    query['ClientId'] = request.clientId;
  }
  if (!Util.isUnset(request.dataNetworkType)) {
    query['DataNetworkType'] = request.dataNetworkType;
  }
  if (!Util.isUnset(request.dataProxySetting)) {
    query['DataProxySetting'] = request.dataProxySetting;
  }
  if (!Util.isUnset(request.maxCpuCore)) {
    query['MaxCpuCore'] = request.maxCpuCore;
  }
  if (!Util.isUnset(request.maxMemory)) {
    query['MaxMemory'] = request.maxMemory;
  }
  if (!Util.isUnset(request.maxWorker)) {
    query['MaxWorker'] = request.maxWorker;
  }
  if (!Util.isUnset(request.proxyHost)) {
    query['ProxyHost'] = request.proxyHost;
  }
  if (!Util.isUnset(request.proxyPassword)) {
    query['ProxyPassword'] = request.proxyPassword;
  }
  if (!Util.isUnset(request.proxyPort)) {
    query['ProxyPort'] = request.proxyPort;
  }
  if (!Util.isUnset(request.proxyUser)) {
    query['ProxyUser'] = request.proxyUser;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.useHttps)) {
    query['UseHttps'] = request.useHttps;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateClientSettings',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates the configurations of an HBR client.
 *
 * @description You can call this operation to update the configurations of both the old and new HBR clients.
 *
 * @param request UpdateClientSettingsRequest
 * @return UpdateClientSettingsResponse
 */
async function updateClientSettings(request: UpdateClientSettingsRequest): UpdateClientSettingsResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateClientSettingsWithOptions(request, runtime);
}

model UpdateContainerClusterRequest {
  clusterId?: string(name='ClusterId', description='Cluster ID.

This parameter is required.', example='cc-000**************134'),
  description?: string(name='Description', description='Cluster description.', example='description ack pv backup'),
  name?: string(name='Name', description='Cluster name.', example='ack_pv_backup_location'),
  networkType?: string(name='NetworkType', description='Network type, with possible values including:
* **CLASSIC**: Classic Network.
* **VPC**: Virtual Private Cloud.', example='VPC'),
  renewToken?: boolean(name='RenewToken', description='Whether to regenerate the token.', example='false'),
}

model UpdateContainerClusterResponseBody = {
  code?: string(name='Code', description='Return code, 200 indicates success.', example='200'),
  message?: string(name='Message', description='Return information.', example='successful'),
  requestId?: string(name='RequestId', description='Request ID.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates if the request was successful.

- true: Success
- false: Failure', example='true'),
  token?: string(name='Token', description='Cluster token, used for registering HBR clients within the cluster.', example='eyJhY2NvdW*****VnZpgXQC5A=='),
  tokenUpdated?: boolean(name='TokenUpdated', description='Indicates whether the cluster token has been updated.', example='false'),
}

model UpdateContainerClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateContainerClusterResponseBody(name='body'),
}

/**
 * @summary Update container cluster information, including the container cluster name, network type, etc.
 *
 * @param request UpdateContainerClusterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateContainerClusterResponse
 */
async function updateContainerClusterWithOptions(request: UpdateContainerClusterRequest, runtime: Util.RuntimeOptions): UpdateContainerClusterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.networkType)) {
    query['NetworkType'] = request.networkType;
  }
  if (!Util.isUnset(request.renewToken)) {
    query['RenewToken'] = request.renewToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateContainerCluster',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Update container cluster information, including the container cluster name, network type, etc.
 *
 * @param request UpdateContainerClusterRequest
 * @return UpdateContainerClusterResponse
 */
async function updateContainerCluster(request: UpdateContainerClusterRequest): UpdateContainerClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateContainerClusterWithOptions(request, runtime);
}

model UpdateHanaBackupPlanRequest {
  backupPrefix?: string(name='BackupPrefix', description='The backup prefix.', example='COMPLETE_DATA_BACKUP'),
  clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance.

This parameter is required.', example='cl-0005dhe******f38'),
  planId?: string(name='PlanId', description='The ID of the backup plan.

This parameter is required.', example='pl-000br3cm4dqvmtph7cul'),
  planName?: string(name='PlanName', description='The name of the backup plan.', example='plan-20211109-162411'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmze36euddwjq'),
  schedule?: string(name='Schedule', description='The backup policy. Format: `I|{startTime}|{interval}`. The system runs the first backup job at a point in time that is specified in the {startTime} parameter and the subsequent backup jobs at an interval that is specified in the {interval} parameter. The system does not run a backup job before the specified point in time. Each backup job, except the first one, starts only after the previous backup job is completed. For example, `I|1631685600|P1D` indicates that the system runs the first backup job at 14:00:00 on September 15, 2021 and the subsequent backup jobs once a day.

*   startTime: the time at which the system starts to run a backup job. The time follows the UNIX time format. Unit: seconds.
*   interval: the interval at which the system runs a backup job. The interval follows the ISO 8601 standard. For example, PT1H indicates an interval of 1 hour. P1D indicates an interval of one day.', example='I|1602673264|P1D'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.

This parameter is required.', example='v-0000rcw******5c6'),
}

model UpdateHanaBackupPlanResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='F23BCC67-09B4-582C-AE70-C813C8548DCC'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model UpdateHanaBackupPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateHanaBackupPlanResponseBody(name='body'),
}

/**
 * @summary Updates an SAP HANA backup plan.
 *
 * @description *   A backup plan defines the data source, backup policy, and other configurations. After you execute a backup plan, a backup job is generated to record the backup progress and the backup result. If a backup job is completed, a backup snapshot is generated. You can use a backup snapshot to create a restore job.
 * *   You can specify only one type of data source in a backup plan.
 * *   You can specify only one interval as a backup cycle in a backup plan.
 * *   Each backup plan allows you to back up data to only one backup vault.
 *
 * @param request UpdateHanaBackupPlanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateHanaBackupPlanResponse
 */
async function updateHanaBackupPlanWithOptions(request: UpdateHanaBackupPlanRequest, runtime: Util.RuntimeOptions): UpdateHanaBackupPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.backupPrefix)) {
    query['BackupPrefix'] = request.backupPrefix;
  }
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  if (!Util.isUnset(request.planName)) {
    query['PlanName'] = request.planName;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.schedule)) {
    query['Schedule'] = request.schedule;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateHanaBackupPlan',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates an SAP HANA backup plan.
 *
 * @description *   A backup plan defines the data source, backup policy, and other configurations. After you execute a backup plan, a backup job is generated to record the backup progress and the backup result. If a backup job is completed, a backup snapshot is generated. You can use a backup snapshot to create a restore job.
 * *   You can specify only one type of data source in a backup plan.
 * *   You can specify only one interval as a backup cycle in a backup plan.
 * *   Each backup plan allows you to back up data to only one backup vault.
 *
 * @param request UpdateHanaBackupPlanRequest
 * @return UpdateHanaBackupPlanResponse
 */
async function updateHanaBackupPlan(request: UpdateHanaBackupPlanRequest): UpdateHanaBackupPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateHanaBackupPlanWithOptions(request, runtime);
}

model UpdateHanaBackupSettingRequest {
  catalogBackupParameterFile?: string(name='CatalogBackupParameterFile', description='The configuration file for catalog backup.', example='/usr/sap/SID/SYS/global/hdb/opt/hdbconfig/param'),
  catalogBackupUsingBackint?: boolean(name='CatalogBackupUsingBackint', description='Specifies whether to use Backint to back up catalogs. Valid values:

*   true: Backint is used to back up catalogs.
*   false: Backint is not used to back up catalogs.

This parameter is required.', example='true'),
  clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance.

This parameter is required.', example='cl-000ezvg******8znz'),
  dataBackupParameterFile?: string(name='DataBackupParameterFile', description='The configuration file for data backup.', example='/usr/sap/SID/SYS/global/hdb/opt/hdbconfig/param'),
  databaseName?: string(name='DatabaseName', description='The name of the database.

This parameter is required.', example='SYSTEMDB'),
  enableAutoLogBackup?: boolean(name='EnableAutoLogBackup', description='Specifies whether to enable automatic log backup. Valid values:

*   **true**: enables automatic log backup.
*   **false**: disables automatic log backup.

This parameter is required.', example='true'),
  logBackupParameterFile?: string(name='LogBackupParameterFile', description='The configuration file for log backup.', example='/usr/sap/SID/SYS/global/hdb/opt/hdbconfig/param'),
  logBackupTimeout?: long(name='LogBackupTimeout', description='The interval at which logs are backed up. Unit: seconds.', example='900'),
  logBackupUsingBackint?: boolean(name='LogBackupUsingBackint', description='Specifies whether to use Backint to back up logs. Valid values:

*   true: Backint is used to back up logs.
*   false: Backint is not used to back up logs.

This parameter is required.', example='true'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-0005n******rluw5'),
}

model UpdateHanaBackupSettingResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4892D474-9A4A-5298-BCD3-E46112A1EFD0'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
}

model UpdateHanaBackupSettingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateHanaBackupSettingResponseBody(name='body'),
}

/**
 * @summary Updates the backup parameters of an SAP HANA database.
 *
 * @description You can call the UpdateHanaRetentionSetting operation to update the backup retention period of a database.
 *
 * @param request UpdateHanaBackupSettingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateHanaBackupSettingResponse
 */
async function updateHanaBackupSettingWithOptions(request: UpdateHanaBackupSettingRequest, runtime: Util.RuntimeOptions): UpdateHanaBackupSettingResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.catalogBackupParameterFile)) {
    query['CatalogBackupParameterFile'] = request.catalogBackupParameterFile;
  }
  if (!Util.isUnset(request.catalogBackupUsingBackint)) {
    query['CatalogBackupUsingBackint'] = request.catalogBackupUsingBackint;
  }
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.dataBackupParameterFile)) {
    query['DataBackupParameterFile'] = request.dataBackupParameterFile;
  }
  if (!Util.isUnset(request.databaseName)) {
    query['DatabaseName'] = request.databaseName;
  }
  if (!Util.isUnset(request.enableAutoLogBackup)) {
    query['EnableAutoLogBackup'] = request.enableAutoLogBackup;
  }
  if (!Util.isUnset(request.logBackupParameterFile)) {
    query['LogBackupParameterFile'] = request.logBackupParameterFile;
  }
  if (!Util.isUnset(request.logBackupTimeout)) {
    query['LogBackupTimeout'] = request.logBackupTimeout;
  }
  if (!Util.isUnset(request.logBackupUsingBackint)) {
    query['LogBackupUsingBackint'] = request.logBackupUsingBackint;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateHanaBackupSetting',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates the backup parameters of an SAP HANA database.
 *
 * @description You can call the UpdateHanaRetentionSetting operation to update the backup retention period of a database.
 *
 * @param request UpdateHanaBackupSettingRequest
 * @return UpdateHanaBackupSettingResponse
 */
async function updateHanaBackupSetting(request: UpdateHanaBackupSettingRequest): UpdateHanaBackupSettingResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateHanaBackupSettingWithOptions(request, runtime);
}

model UpdateHanaInstanceRequest {
  alertSetting?: string(name='AlertSetting', description='The alert settings. Valid value: INHERITED, which indicates that the Cloud Backup client sends alert notifications by using the same method configured for the backup vault.', example='INHERITED'),
  clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance.', example='cl-000axjt******c6j8'),
  hanaName?: string(name='HanaName', description='The name of the SAP HANA instance.', example='SAP-HANA-DEV'),
  host?: string(name='Host', description='The private or internal IP address of the host where the primary node of the SAP HANA instance resides.', example='47.100.XX.XX'),
  instanceNumber?: int32(name='InstanceNumber', description='The instance number of the SAP HANA system.

This parameter is required.', example='00'),
  password?: string(name='Password', description='The password that is used to connect with the SAP HANA database.', example='**********'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-aekzvx7d3c4kpny'),
  useSsl?: boolean(name='UseSsl', description='Specifies whether to connect with the SAP HANA database over Secure Sockets Layer (SSL). Valid values:

*   true: The SAP HANA database is connected over SSL.
*   false: The SAP HANA database is not connected over SSL.

This parameter is required.', example='true'),
  userName?: string(name='UserName', description='The username of the SYSTEMDB database.', example='admin'),
  validateCertificate?: boolean(name='ValidateCertificate', description='Specifies whether to verify the SSL certificate of the SAP HANA database. Valid values:

*   true: The SSL certificate of the SAP HANA database is verified.
*   false: The SSL certificate of the SAP HANA database is not verified.

This parameter is required.', example='false'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-0003v4ah******9xp'),
}

model UpdateHanaInstanceResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='A6AB6D5A-9D21-5529-9335-A894FB045ED6'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model UpdateHanaInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateHanaInstanceResponseBody(name='body'),
}

/**
 * @summary Updates an SAP HANA instance.
 *
 * @param request UpdateHanaInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateHanaInstanceResponse
 */
async function updateHanaInstanceWithOptions(request: UpdateHanaInstanceRequest, runtime: Util.RuntimeOptions): UpdateHanaInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.alertSetting)) {
    query['AlertSetting'] = request.alertSetting;
  }
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.hanaName)) {
    query['HanaName'] = request.hanaName;
  }
  if (!Util.isUnset(request.host)) {
    query['Host'] = request.host;
  }
  if (!Util.isUnset(request.instanceNumber)) {
    query['InstanceNumber'] = request.instanceNumber;
  }
  if (!Util.isUnset(request.password)) {
    query['Password'] = request.password;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.useSsl)) {
    query['UseSsl'] = request.useSsl;
  }
  if (!Util.isUnset(request.userName)) {
    query['UserName'] = request.userName;
  }
  if (!Util.isUnset(request.validateCertificate)) {
    query['ValidateCertificate'] = request.validateCertificate;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateHanaInstance',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates an SAP HANA instance.
 *
 * @param request UpdateHanaInstanceRequest
 * @return UpdateHanaInstanceResponse
 */
async function updateHanaInstance(request: UpdateHanaInstanceRequest): UpdateHanaInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateHanaInstanceWithOptions(request, runtime);
}

model UpdateHanaRetentionSettingRequest {
  clusterId?: string(name='ClusterId', description='The ID of the SAP HANA instance.

This parameter is required.', example='cl-00024vyjj******srrq'),
  databaseName?: string(name='DatabaseName', description='The database name.

This parameter is required.', example='SYSTEMDB'),
  disabled?: boolean(name='Disabled', description='Specifies whether to permanently retain the backup. Valid values:

*   true: The backup is permanently retained.
*   false: The backup is retained for the specified number of days.

This parameter is required.', example='false'),
  retentionDays?: long(name='RetentionDays', description='The retention period of the backup data. Unit: days. If you set the Disabled parameter to false, the backup is retained for the number of days specified by this parameter.

This parameter is required.', example='90'),
  schedule?: string(name='Schedule', description='The policy to update the retention period. Format: `I|{startTime}|{interval}`. The retention period is updated at an interval of {interval} starting from {startTime}.

*   startTime: the time at which the system starts to run a backup job. The time follows the UNIX time format. Unit: seconds.
*   interval: the interval at which the system runs a backup job. The interval follows the ISO 8601 standard. For example, PT1H indicates an interval of 1 hour, and P1D indicates an interval of one day.

This parameter is required.', example='I|0|P1D'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.

This parameter is required.', example='v-000fb0v2ly******k6'),
}

model UpdateHanaRetentionSettingResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='7BEE26EB-8EE3-57A0-A9DE-5FD700165DE5'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model UpdateHanaRetentionSettingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateHanaRetentionSettingResponseBody(name='body'),
}

/**
 * @summary Updates the backup retention period of an SAP HANA database.
 *
 * @description *   If you want to update the backup parameters of a database, you can call the UpdateHanaBackupSetting operation.
 * *   Cloud Backup deletes the expired catalogs and data that are related to Backint and file backup. The deleted catalogs and data cannot be restored. We recommend that you set the retention period based on your business requirements.
 *
 * @param request UpdateHanaRetentionSettingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateHanaRetentionSettingResponse
 */
async function updateHanaRetentionSettingWithOptions(request: UpdateHanaRetentionSettingRequest, runtime: Util.RuntimeOptions): UpdateHanaRetentionSettingResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.databaseName)) {
    query['DatabaseName'] = request.databaseName;
  }
  if (!Util.isUnset(request.disabled)) {
    query['Disabled'] = request.disabled;
  }
  if (!Util.isUnset(request.retentionDays)) {
    query['RetentionDays'] = request.retentionDays;
  }
  if (!Util.isUnset(request.schedule)) {
    query['Schedule'] = request.schedule;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateHanaRetentionSetting',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates the backup retention period of an SAP HANA database.
 *
 * @description *   If you want to update the backup parameters of a database, you can call the UpdateHanaBackupSetting operation.
 * *   Cloud Backup deletes the expired catalogs and data that are related to Backint and file backup. The deleted catalogs and data cannot be restored. We recommend that you set the retention period based on your business requirements.
 *
 * @param request UpdateHanaRetentionSettingRequest
 * @return UpdateHanaRetentionSettingResponse
 */
async function updateHanaRetentionSetting(request: UpdateHanaRetentionSettingRequest): UpdateHanaRetentionSettingResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateHanaRetentionSettingWithOptions(request, runtime);
}

model UpdatePolicyBindingRequest {
  advancedOptions?: {
    commonFileSystemDetail?: {
      fetchSliceSize?: long(name='FetchSliceSize', description='The size of backup shards (the number of files).', example='100000'),
      fullOnIncrementFail?: boolean(name='FullOnIncrementFail', description='Specifies whether the system performs full backup if incremental backup fails. Valid values:

*   **true**: The system performs full backup if incremental backup fails.
*   **false**: The system does not perform full backup if incremental backup fails.', example='true'),
    }(name='CommonFileSystemDetail', description='The details about large-scale file system backup.'),
    ossDetail?: {
      ignoreArchiveObject?: boolean(name='IgnoreArchiveObject', description='Do not prompt for archival type objects in task statistics and failed file lists.', example='true'),
      inventoryCleanupPolicy?: string(name='InventoryCleanupPolicy', description='Specifies whether the system deletes the inventory lists when a backup is completed. This parameter is valid only when OSS inventories are used. Valid values:

*   **NO_CLEANUP**: does not delete inventory lists.
*   **DELETE_CURRENT**: deletes the current inventory list.
*   **DELETE_CURRENT_AND_PREVIOUS**: deletes all inventory lists.', example='NO_CLEANUP'),
      inventoryId?: string(name='InventoryId', description='The name of the OSS inventory. If this parameter is not empty, the OSS inventory is used for performance optimization.

*   If you want to back up more than 100 million OSS objects, we recommend that you use inventory lists to accelerate incremental backup. Storage fees for inventory lists are included into your OSS bills.
*   A certain amount of time is required for OSS to generate inventory lists. Before inventory lists are generated, OSS objects may fail to be backed up. In this case, you can back up the OSS objects in the next backup cycle.', example='30663060'),
    }(name='OssDetail', description='The details about Object Storage Service (OSS) backup.'),
    udmDetail?: {
      appConsistent?: boolean(name='AppConsistent', description='Specifies whether to enable application consistency. You can enable application consistency only if all disks are ESSDs.', example='false'),
      diskIdList?: [ string ](name='DiskIdList', description='The IDs of the disks that need to be protected. If all disks need to be protected, this parameter is empty.'),
      enableFsFreeze?: boolean(name='EnableFsFreeze', description='This parameter is required only if you set the **AppConsistent** parameter to **true**. This parameter specifies whether to enable Linux fsfreeze to put file systems into the read-only state before application-consistent snapshots are created. Default value: true.', example='true'),
      enableWriters?: boolean(name='EnableWriters', description='This parameter is required only if you set the **AppConsistent** parameter to **true**. This parameter specifies whether to create application-consistent snapshots. Valid values:

*   true: creates application-consistent snapshots
*   false: creates file system-consistent snapshots

Default value: true.', example='true'),
      excludeDiskIdList?: [ string ](name='ExcludeDiskIdList', description='The IDs of the disks that do not need to be protected. If the DiskIdList parameter is not empty, this parameter is ignored.'),
      postScriptPath?: string(name='PostScriptPath', description='This parameter is required only if you set the **AppConsistent** parameter to **true**. This parameter specifies the path of the post-thaw scripts that are executed after application-consistent snapshots are created.', example='/tmp/postscript.sh'),
      preScriptPath?: string(name='PreScriptPath', description='This parameter is required only if you set the **AppConsistent** parameter to **true**. This parameter specifies the path of the pre-freeze scripts that are executed before application-consistent snapshots are created.', example='/tmp/prescript.sh'),
      ramRoleName?: string(name='RamRoleName', description='This parameter is required only if you set the **AppConsistent** parameter to **true**. This parameter specifies the name of the Resource Access Management (RAM) role that is required to create application-consistent snapshots.', example='AliyunECSInstanceForHbrRole'),
      snapshotGroup?: boolean(name='SnapshotGroup', description='Specifies whether to create a snapshot-consistent group. You can create a snapshot-consistent group only if all disks are Enterprise SSDs (ESSDs).', example='true'),
      timeoutInSeconds?: long(name='TimeoutInSeconds', description='This parameter is required only if you set the **AppConsistent** parameter to **true**. This parameter specifies the I/O freeze timeout period. Default value: 30. Unit: seconds.', example='30'),
    }(name='UdmDetail', description='The details about Elastic Compute Service (ECS) instance backup.'),
  }(name='AdvancedOptions', description='The advanced options.'),
  dataSourceId?: string(name='DataSourceId', description='The ID of the data source.

This parameter is required.', example='i-bp1************dtv'),
  disabled?: boolean(name='Disabled', description='Specifies whether to disable the backup policy for the data source. Valid values:

*   true: disables the backup policy for the data source
*   false: enables the backup policy for the data source', example='true'),
  exclude?: string(name='Exclude', description='This parameter is required only if you set the **SourceType** parameter to **ECS_FILE** or **File**. This parameter specifies the type of files that do not need to be backed up. No files of the specified type are backed up. The value can be up to 255 characters in length.', example='[\\\\"*.doc\\\\",\\\\"*.xltm\\\\"]'),
  include?: string(name='Include', description='This parameter is required only if you set the **SourceType** parameter to **ECS_FILE** or **File**. This parameter specifies the type of files to be backed up. All files of the specified type are backed up. The value can be up to 255 characters in length.', example='[\\\\"*.doc\\\\",\\\\"*.xltm\\\\"]'),
  policyBindingDescription?: string(name='PolicyBindingDescription', description='The description of the association.', example='po-000************5xx-i-2ze************nw4'),
  policyId?: string(name='PolicyId', description='The ID of the backup policy.

This parameter is required.', example='po-000************ky9'),
  source?: string(name='Source', description='*   If the SourceType parameter is set to **OSS**, set the Source parameter to the prefix of the path to the folder that you want to back up. If you do not specify the Source parameter, the entire bucket (root directory) is backed up.
*   If the SourceType parameter is set to **ECS_FILE** or **File**, set the Source parameter to the path to the files that you want to back up. If you do not specify the Source parameter, all paths backed up.', example='backup/'),
  sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **UDM_ECS**: ECS instance backup

This parameter is required.', example='UDM_ECS'),
  speedLimit?: string(name='SpeedLimit', description='This parameter is required only if you set the **SourceType** parameter to **ECS_FILE** or **File**. This parameter specifies the throttling rules. Format: `{start}{end}{bandwidth}`. Separate multiple throttling rules with vertical bars (|). The time ranges of the throttling rules cannot overlap.

*   **start**: the start hour.
*   **end**: the end hour.
*   **bandwidth**: the bandwidth. Unit: KB/s.', example='0:24:5120'),
}

model UpdatePolicyBindingShrinkRequest {
  advancedOptionsShrink?: string(name='AdvancedOptions', description='The advanced options.'),
  dataSourceId?: string(name='DataSourceId', description='The ID of the data source.

This parameter is required.', example='i-bp1************dtv'),
  disabled?: boolean(name='Disabled', description='Specifies whether to disable the backup policy for the data source. Valid values:

*   true: disables the backup policy for the data source
*   false: enables the backup policy for the data source', example='true'),
  exclude?: string(name='Exclude', description='This parameter is required only if you set the **SourceType** parameter to **ECS_FILE** or **File**. This parameter specifies the type of files that do not need to be backed up. No files of the specified type are backed up. The value can be up to 255 characters in length.', example='[\\\\"*.doc\\\\",\\\\"*.xltm\\\\"]'),
  include?: string(name='Include', description='This parameter is required only if you set the **SourceType** parameter to **ECS_FILE** or **File**. This parameter specifies the type of files to be backed up. All files of the specified type are backed up. The value can be up to 255 characters in length.', example='[\\\\"*.doc\\\\",\\\\"*.xltm\\\\"]'),
  policyBindingDescription?: string(name='PolicyBindingDescription', description='The description of the association.', example='po-000************5xx-i-2ze************nw4'),
  policyId?: string(name='PolicyId', description='The ID of the backup policy.

This parameter is required.', example='po-000************ky9'),
  source?: string(name='Source', description='*   If the SourceType parameter is set to **OSS**, set the Source parameter to the prefix of the path to the folder that you want to back up. If you do not specify the Source parameter, the entire bucket (root directory) is backed up.
*   If the SourceType parameter is set to **ECS_FILE** or **File**, set the Source parameter to the path to the files that you want to back up. If you do not specify the Source parameter, all paths backed up.', example='backup/'),
  sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **UDM_ECS**: ECS instance backup

This parameter is required.', example='UDM_ECS'),
  speedLimit?: string(name='SpeedLimit', description='This parameter is required only if you set the **SourceType** parameter to **ECS_FILE** or **File**. This parameter specifies the throttling rules. Format: `{start}{end}{bandwidth}`. Separate multiple throttling rules with vertical bars (|). The time ranges of the throttling rules cannot overlap.

*   **start**: the start hour.
*   **end**: the end hour.
*   **bandwidth**: the bandwidth. Unit: KB/s.', example='0:24:5120'),
}

model UpdatePolicyBindingResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='B6F24C46-54B9-519B-9AB8-A8988D705E67'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model UpdatePolicyBindingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdatePolicyBindingResponseBody(name='body'),
}

/**
 * @summary Modifies the association between a backup policy and a data source.
 *
 * @param tmpReq UpdatePolicyBindingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdatePolicyBindingResponse
 */
async function updatePolicyBindingWithOptions(tmpReq: UpdatePolicyBindingRequest, runtime: Util.RuntimeOptions): UpdatePolicyBindingResponse {
  Util.validateModel(tmpReq);
  var request = new UpdatePolicyBindingShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.advancedOptions)) {
    request.advancedOptionsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.advancedOptions, 'AdvancedOptions', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.advancedOptionsShrink)) {
    query['AdvancedOptions'] = request.advancedOptionsShrink;
  }
  if (!Util.isUnset(request.disabled)) {
    query['Disabled'] = request.disabled;
  }
  if (!Util.isUnset(request.exclude)) {
    query['Exclude'] = request.exclude;
  }
  if (!Util.isUnset(request.include)) {
    query['Include'] = request.include;
  }
  if (!Util.isUnset(request.policyBindingDescription)) {
    query['PolicyBindingDescription'] = request.policyBindingDescription;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  if (!Util.isUnset(request.speedLimit)) {
    query['SpeedLimit'] = request.speedLimit;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.dataSourceId)) {
    body['DataSourceId'] = request.dataSourceId;
  }
  if (!Util.isUnset(request.policyId)) {
    body['PolicyId'] = request.policyId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdatePolicyBinding',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the association between a backup policy and a data source.
 *
 * @param request UpdatePolicyBindingRequest
 * @return UpdatePolicyBindingResponse
 */
async function updatePolicyBinding(request: UpdatePolicyBindingRequest): UpdatePolicyBindingResponse {
  var runtime = new Util.RuntimeOptions{};
  return updatePolicyBindingWithOptions(request, runtime);
}

model UpdatePolicyV2Request {
  policyDescription?: string(name='PolicyDescription', description='The description of the backup policy.', example='Data is backed up at 10:00:00 every day and replicated to the China (Shanghai) region for geo-redundancy.'),
  policyId?: string(name='PolicyId', description='The ID of the backup policy.', example='po-000************viy'),
  policyName?: string(name='PolicyName', description='The name of the backup policy.', example='Daily Local Backup + Remote Backup'),
  rules?: [ 
    {
      archiveDays?: long(name='ArchiveDays', description='This parameter is required only if the **RuleType** parameter is set to **TRANSITION**. This parameter specifies the time when data is dumped from a backup vault to an archive vault. Unit: days.', example='90'),
      backupType?: string(name='BackupType', description='This parameter is required only if the **RuleType** parameter is set to **BACKUP**. This parameter specifies the backup type. Valid value: **COMPLETE**, which indicates full backup.', example='COMPLETE'),
      coldArchiveDays?: long(name='ColdArchiveDays', description='This parameter is required only if the **RuleType** parameter is set to **TRANSITION**. This parameter specifies the time when data is dumped from a backup vault to a cold archive vault. Unit: days.', example='365'),
      dataSourceFilters?: [ 
        {
          dataSourceIds?: [ string ](name='DataSourceIds', description='This parameter is deprecated.'),
          sourceType?: string(name='SourceType', description='The type of the data source. Valid values:

*   **UDM_ECS**: Elastic Compute Service (ECS) instance This type of data source is supported only if the **RuleType** parameter is set to **UDM_ECS_ONLY**.
*   **OSS**: Object Storage Service (OSS) bucket This type of data source is supported only if the **RuleType** parameter is set to **STANDARD**.
*   **NAS**: File Storage NAS (NAS) file system This type of data source is supported only if the **RuleType** parameter is set to **STANDARD**.
*   **ECS_FILE**: ECS file This type of data source is supported only if the **RuleType** parameter is set to **STANDARD**.
*   **OTS**: Tablestore instance This type of data source is supported only if the **RuleType** parameter is set to **STANDARD**.', example='UDM_ECS'),
        }
      ](name='DataSourceFilters', description='This parameter is required only if the **RuleType** parameter is set to **TAG**. This parameter specifies the data source filter rule.'),
      immutable?: boolean(name='Immutable', description='This parameter is required only if the **PolicyType** parameter is set to **UDM_ECS_ONLY**. This parameter specifies whether to enable the immutable backup feature.', example='true'),
      keepLatestSnapshots?: long(name='KeepLatestSnapshots', description='Specifies whether to enable the feature of keeping at least one backup version. Valid values:

*   0: The feature is disabled.
*   1: The feature is enabled.', example='1'),
      replicationRegionId?: string(name='ReplicationRegionId', description='This parameter is required only if the **RuleType** parameter is set to **REPLICATION**. This parameter specifies the ID of the destination region.', example='cn-shanghai'),
      retention?: long(name='Retention', description='This parameter is required only if the **RuleType** parameter is set to **TRANSITION** or **REPLICATION**.

*   If the **RuleType** parameter is set to **TRANSITION**, this parameter specifies the retention period of the backup data. Minimum value: 1. Unit: days.
*   If the **RuleType** parameter is set to **REPLICATION**, this parameter specifies the retention period of remote backups. Minimum value: 1. Unit: days.', example='7'),
      retentionRules?: [ 
        {
          advancedRetentionType?: string(name='AdvancedRetentionType', description='The type of the special retention rule. Valid values:

*   **WEEKLY**: retains weekly backups
*   **MONTHLY**: retains monthly backups
*   **YEARLY**: retains yearly backups', example='YEARLY'),
          retention?: long(name='Retention', description='The special retention period of backups. Minimum value: 1. Unit: days.', example='365'),
          whichSnapshot?: long(name='WhichSnapshot', description='Specifies which backup is retained based on the special retention rule. Only the first backup can be retained.', example='1'),
        }
      ](name='RetentionRules', description='This parameter is required only if the **RuleType** parameter is set to **TRANSITION**. This parameter specifies the special retention rules.'),
      ruleId?: string(name='RuleId', description='The rule ID.', example='rule-000************rof'),
      ruleType?: string(name='RuleType', description='The type of the rule. Each backup policy must have at least one rule of the **BACKUP** type and only one rule of the **TRANSITION** type. Valid values:

*   **BACKUP**: backup rule
*   **TRANSITION**: lifecycle rule
*   **REPLICATION**: replication rule', example='BACKUP'),
      schedule?: string(name='Schedule', description='This parameter is required only if the **RuleType** parameter is set to **BACKUP**. This parameter specifies the backup schedule settings. Formats:

*   `I|{startTime}|{interval}`: The system runs the first backup job at a point in time that is specified in the {startTime} parameter and the subsequent backup jobs at an interval that is specified in the {interval} parameter. For example, `I|1631685600|P1D` indicates that the system runs the first backup job at 14:00:00 on September 15, 2021 and the subsequent backup jobs once a day.

    *   startTime: the time at which the system starts to run a backup job. The time must follow the UNIX time format. Unit: seconds.
    *   interval: the interval at which the system runs a backup job. The interval must follow the ISO 8601 standard. For example, `PT1H` specifies an interval of 1 hour. `P1D` specifies an interval of one day.

*   `C|{startTime}|{crontab}`: The system runs backup jobs at a point in time that is specified in the {startTime} parameter based on the {crontab} expression. For example, C|1631685600|0 0 2 ?\\\\* 3,5,7 indicates that the system runs backup jobs at 02:00:00 every Tuesday, Thursday, and Saturday from14:00:00 on September 15, 2021.``

    *   startTime: the time at which the system starts to run a backup job. The time must follow the UNIX time format. Unit: seconds.
    *   crontab: the crontab expression. For example, 0 0 2 ?\\\\* 3,5,7 indicates 02:00:00 every Tuesday, Thursday, and Saturday.``

The system does not run a backup job before the specified point in time. Each backup job, except the first one, starts only after the previous backup job is completed.', example='I|1648647166|P1D'),
      tagFilters?: [ 
        {
          key?: string(name='Key', description='The tag key.', example='env'),
          operator?: string(name='Operator', description='The tag-based matching rule. Valid values:

*   **EQUAL**: Both the tag key and tag value are matched.
*   **NOT**: The tag key is matched and the tag value is not matched.', example='EQUAL'),
          value?: string(name='Value', description='The tag value. If you leave this parameter empty, the value is any value.', example='prod'),
        }
      ](name='TagFilters', description='This parameter is required only if the **RuleType** parameter is set to **TAG**. This parameter specifies the resource tag filter rule.'),
      vaultId?: string(name='VaultId', description='This parameter is required only if the RuleType parameter is set to BACKUP. The ID of the backup vault.', example='v-0001************aseg'),
    }
  ](name='Rules', description='The rules in the backup policy.'),
}

model UpdatePolicyV2ShrinkRequest {
  policyDescription?: string(name='PolicyDescription', description='The description of the backup policy.', example='Data is backed up at 10:00:00 every day and replicated to the China (Shanghai) region for geo-redundancy.'),
  policyId?: string(name='PolicyId', description='The ID of the backup policy.', example='po-000************viy'),
  policyName?: string(name='PolicyName', description='The name of the backup policy.', example='Daily Local Backup + Remote Backup'),
  rulesShrink?: string(name='Rules', description='The rules in the backup policy.'),
}

model UpdatePolicyV2ResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
}

model UpdatePolicyV2Response = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdatePolicyV2ResponseBody(name='body'),
}

/**
 * @summary Modifies a backup policy.
 *
 * @description If you modify a backup policy, the modification takes effect on all data sources that are bound to the backup policy. Proceed with caution.
 *
 * @param tmpReq UpdatePolicyV2Request
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdatePolicyV2Response
 */
async function updatePolicyV2WithOptions(tmpReq: UpdatePolicyV2Request, runtime: Util.RuntimeOptions): UpdatePolicyV2Response {
  Util.validateModel(tmpReq);
  var request = new UpdatePolicyV2ShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.rules)) {
    request.rulesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.rules, 'Rules', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.policyDescription)) {
    body['PolicyDescription'] = request.policyDescription;
  }
  if (!Util.isUnset(request.policyId)) {
    body['PolicyId'] = request.policyId;
  }
  if (!Util.isUnset(request.policyName)) {
    body['PolicyName'] = request.policyName;
  }
  if (!Util.isUnset(request.rulesShrink)) {
    body['Rules'] = request.rulesShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdatePolicyV2',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies a backup policy.
 *
 * @description If you modify a backup policy, the modification takes effect on all data sources that are bound to the backup policy. Proceed with caution.
 *
 * @param request UpdatePolicyV2Request
 * @return UpdatePolicyV2Response
 */
async function updatePolicyV2(request: UpdatePolicyV2Request): UpdatePolicyV2Response {
  var runtime = new Util.RuntimeOptions{};
  return updatePolicyV2WithOptions(request, runtime);
}

model UpdateVaultRequest {
  description?: string(name='Description', description='The description of the backup vault. The description must be 0 to 255 characters in length.', example='vault description'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfm2fa2xeiebyy'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.

This parameter is required.', example='v-*********************'),
  vaultName?: string(name='VaultName', description='The name of the backup vault. The name must be 1 to 64 characters in length.', example='vaultname'),
  wormEnabled?: boolean(name='WormEnabled', description='Specifies whether to enable the immutable backup feature for storage vaults. After the immutable backup feature is enabled, backup vaults and all backup data cannot be deleted until the retention period expires. The immutable backup feature cannot be disabled after it is enabled. Only standard backup vaults and archive vaults support the immutable backup feature.', example='true'),
}

model UpdateVaultResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, a success message is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model UpdateVaultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateVaultResponseBody(name='body'),
}

/**
 * @summary Updates the configuration information about the backup vault.
 *
 * @param request UpdateVaultRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateVaultResponse
 */
async function updateVaultWithOptions(request: UpdateVaultRequest, runtime: Util.RuntimeOptions): UpdateVaultResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  if (!Util.isUnset(request.vaultName)) {
    query['VaultName'] = request.vaultName;
  }
  if (!Util.isUnset(request.wormEnabled)) {
    query['WormEnabled'] = request.wormEnabled;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateVault',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates the configuration information about the backup vault.
 *
 * @param request UpdateVaultRequest
 * @return UpdateVaultResponse
 */
async function updateVault(request: UpdateVaultRequest): UpdateVaultResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateVaultWithOptions(request, runtime);
}

model UpgradeBackupClientsRequest {
  clientIds?: map[string]any(name='ClientIds', description='The IDs of Cloud Backup clients. The total number of Cloud Backup client IDs and ECS instance IDs cannot exceed 100.', example='["i-0xi5wj******3j3bh2gj5"]'),
  crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the RAM role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='hbrcrossrole'),
  crossAccountType?: string(name='CrossAccountType', description='Specifies whether data is backed up within the same Alibaba Cloud account or across Alibaba Cloud accounts. Valid values:

*   SELF_ACCOUNT: Data is backed up within the same Alibaba Cloud account.
*   CROSS_ACCOUNT: Data is backed up across Alibaba Cloud accounts.', example='CROSS_ACCOUNT'),
  crossAccountUserId?: long(name='CrossAccountUserId', description='The ID of the source Alibaba Cloud account that authorizes the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='1283948272xxxxx'),
  instanceIds?: map[string]any(name='InstanceIds', description='The IDs of Elastic Compute Service (ECS) instances. The total number of ECS instance IDs and Cloud Backup client IDs cannot exceed 100.', example='["c-*********************"]'),
}

model UpgradeBackupClientsShrinkRequest {
  clientIdsShrink?: string(name='ClientIds', description='The IDs of Cloud Backup clients. The total number of Cloud Backup client IDs and ECS instance IDs cannot exceed 100.', example='["i-0xi5wj******3j3bh2gj5"]'),
  crossAccountRoleName?: string(name='CrossAccountRoleName', description='The name of the RAM role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='hbrcrossrole'),
  crossAccountType?: string(name='CrossAccountType', description='Specifies whether data is backed up within the same Alibaba Cloud account or across Alibaba Cloud accounts. Valid values:

*   SELF_ACCOUNT: Data is backed up within the same Alibaba Cloud account.
*   CROSS_ACCOUNT: Data is backed up across Alibaba Cloud accounts.', example='CROSS_ACCOUNT'),
  crossAccountUserId?: long(name='CrossAccountUserId', description='The ID of the source Alibaba Cloud account that authorizes the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.', example='1283948272xxxxx'),
  instanceIdsShrink?: string(name='InstanceIds', description='The IDs of Elastic Compute Service (ECS) instances. The total number of ECS instance IDs and Cloud Backup client IDs cannot exceed 100.', example='["c-*********************"]'),
}

model UpgradeBackupClientsResponseBody = {
  code?: string(name='Code', description='The HTTP status code. The status code 200 indicates that the call is successful.', example='200'),
  instanceStatuses?: [ 
    {
      errorCode?: string(name='ErrorCode', description='The error code that is returned. Valid values:

*   If the value is empty, the call is successful.
*   **InstanceNotExists**: The ECS instance does not exist.
*   **InstanceNotRunning**: The ECS instance is not running.
*   **CloudAssistNotRunningOnInstance**: Cloud Assistant is unavailable.', example='InstanceNotExists'),
      instanceId?: string(name='InstanceId', description='The ID of the ECS instance.', example='i-0xi5w***v3j3bh2gj5'),
      validInstance?: boolean(name='ValidInstance', description='Indicates whether an HBR client can be installed on the ECS instance. Valid values:

*   true: An HBR client can be installed on the ECS instance.
*   false: An HBR client cannot be installed on the ECS instance.', example='true'),
    }
  ](name='InstanceStatuses', description='The status of the ECS instance. If the status of an ECS instance cannot meet the requirements to install an HBR client and the value of the InstanceIds parameter is greater than 1, an error message is returned based on the value of this parameter.'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
  taskId?: string(name='TaskId', description='The ID of the asynchronous job. You can call the DescribeTask operation to query the execution result of an asynchronous job.', example='t-*********************'),
}

model UpgradeBackupClientsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpgradeBackupClientsResponseBody(name='body'),
}

/**
 * @summary Upgrades an HBR client on one or more Elastic Compute Service (ECS) instances.
 *
 * @description *   This operation creates an asynchronous job at the backend and calls Cloud Assistant to upgrade an HBR client that is installed on an ECS instance.
 * *   You can call the DescribeTask operation to query the execution result of an asynchronous job.
 * *   The timeout period of an asynchronous job is 15 minutes.
 *
 * @param tmpReq UpgradeBackupClientsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpgradeBackupClientsResponse
 */
async function upgradeBackupClientsWithOptions(tmpReq: UpgradeBackupClientsRequest, runtime: Util.RuntimeOptions): UpgradeBackupClientsResponse {
  Util.validateModel(tmpReq);
  var request = new UpgradeBackupClientsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.clientIds)) {
    request.clientIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.clientIds, 'ClientIds', 'json');
  }
  if (!Util.isUnset(tmpReq.instanceIds)) {
    request.instanceIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.instanceIds, 'InstanceIds', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.clientIdsShrink)) {
    query['ClientIds'] = request.clientIdsShrink;
  }
  if (!Util.isUnset(request.crossAccountRoleName)) {
    query['CrossAccountRoleName'] = request.crossAccountRoleName;
  }
  if (!Util.isUnset(request.crossAccountType)) {
    query['CrossAccountType'] = request.crossAccountType;
  }
  if (!Util.isUnset(request.crossAccountUserId)) {
    query['CrossAccountUserId'] = request.crossAccountUserId;
  }
  if (!Util.isUnset(request.instanceIdsShrink)) {
    query['InstanceIds'] = request.instanceIdsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpgradeBackupClients',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Upgrades an HBR client on one or more Elastic Compute Service (ECS) instances.
 *
 * @description *   This operation creates an asynchronous job at the backend and calls Cloud Assistant to upgrade an HBR client that is installed on an ECS instance.
 * *   You can call the DescribeTask operation to query the execution result of an asynchronous job.
 * *   The timeout period of an asynchronous job is 15 minutes.
 *
 * @param request UpgradeBackupClientsRequest
 * @return UpgradeBackupClientsResponse
 */
async function upgradeBackupClients(request: UpgradeBackupClientsRequest): UpgradeBackupClientsResponse {
  var runtime = new Util.RuntimeOptions{};
  return upgradeBackupClientsWithOptions(request, runtime);
}

model UpgradeClientRequest {
  clientId?: string(name='ClientId', description='The ID of the Cloud Backup client.', example='c-000boklw******63a9'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmy6uja5wyc2i'),
  vaultId?: string(name='VaultId', description='The ID of the backup vault.', example='v-000djw8ci******3ic'),
}

model UpgradeClientResponseBody = {
  code?: string(name='Code', description='The response code. The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='22D97921-16BD-547C-B175-1DC25B1DCD73'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  taskId?: string(name='TaskId', description='The ID of the asynchronous job. You can call the DescribeTask operation to query the execution result of an asynchronous job.', example='t-000i97jujk0z58a2ignf'),
}

model UpgradeClientResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpgradeClientResponseBody(name='body'),
}

/**
 * @summary Upgrades the Cloud Backup client.
 *
 * @description You can call this operation to upgrade a Cloud Backup client to the latest version. After the Cloud Backup client is upgraded, the version of the client cannot be rolled back.
 *
 * @param request UpgradeClientRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpgradeClientResponse
 */
async function upgradeClientWithOptions(request: UpgradeClientRequest, runtime: Util.RuntimeOptions): UpgradeClientResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientId)) {
    query['ClientId'] = request.clientId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.vaultId)) {
    query['VaultId'] = request.vaultId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpgradeClient',
    version = '2017-09-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Upgrades the Cloud Backup client.
 *
 * @description You can call this operation to upgrade a Cloud Backup client to the latest version. After the Cloud Backup client is upgraded, the version of the client cannot be rolled back.
 *
 * @param request UpgradeClientRequest
 * @return UpgradeClientResponse
 */
async function upgradeClient(request: UpgradeClientRequest): UpgradeClientResponse {
  var runtime = new Util.RuntimeOptions{};
  return upgradeClientWithOptions(request, runtime);
}

